Ibtesam-Mahmood/Rime-SDK

getChannelGroups potential future issue

Closed this issue · 2 comments

This strategy may fail when you take into account deleting channels/removing them from channel groups

If cg1 is full, channels start to go into cg2
But what if a channel gets deleted from cg1? The lowest available cg will now be cg1
Thus this function will miss a partially filled cg2

I don't know if this issue is properly pointing to the code

static Future<List<String>> getChannelGroups(String loginID) async {
  String availableGroup =
      await RimeFunctions.getAvailableChannelGroup(loginID);

  int groupNo = int.parse(availableGroup.split('_').last);

  return List.generate(
      groupNo + 1, (index) => RimeFunctions.channelGroupID(loginID, index));
}

The approach for getChannelGroups has been updated and this should no longer be an issue.

The initialize will now subscribe to all the non-empty channel groups.