Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Room List Store: Support filters by implementing just the favourite filter #29433

Merged
merged 6 commits into from
Mar 6, 2025

Conversation

MidhunSureshR
Copy link
Member

  • A filter has a method to check if a given room satisfies some condition and a key that uniquely identifies it.
  • Every room node tracks which filters apply to it and provides methods to recalculate and query this info.
  • This calculation is done once for all room nodes when the skip list is built.
  • This calculation is repeated only for the rooms that get updated (i.e gets re-inserted into the skiplist).
  • Getting a list of filtered rooms is as simple as skipping the rooms that do not have the given filter keys in the iterator.

This PR only implements the favourite filter.

- Holds data to indicate which filters apply
- Provides method to check if a given set of filters apply to this node
- Provides a method to recalculate which filters apply
Comment on lines 37 to 41
while (current) {
if (current.isInActiveSpace && current.doesRoomMatchFilters(this.filters)) break;
else current = current.next[0];
}
if (!current) return { value: undefined, done: true };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code style here doesn't really match the rest of the codebase

Copy link
Member Author

@MidhunSureshR MidhunSureshR Mar 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if conditions without braces?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

else without braces namely

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still not sure what the code style actually is though. Our code_Style.md says:

When a statement's body is a single line, it must be written without curly braces, so long as the body is placed on the same line as the statement.

@MidhunSureshR MidhunSureshR added this pull request to the merge queue Mar 6, 2025
Merged via the queue into develop with commit 7ff1fd2 Mar 6, 2025
32 checks passed
@MidhunSureshR MidhunSureshR deleted the midhun/rls/favourite-filter branch March 6, 2025 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants