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

crypto: emit no identities_stream items on no-op changes #3442

Merged
merged 4 commits into from
May 23, 2024

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented May 22, 2024

Fixes: element-hq/element-web#27165.

Currently, whenever we receive a /keys/query response, we emit items from identities_stream_raw and devices_stream for any users listed in the response, even if there was no actual change to the devices. This PR changes behaviour so that items are only emitted if there are actual changes.

  • Public API changes documented in changelogs (optional)

@richvdh richvdh requested a review from a team as a code owner May 22, 2024 12:37
@richvdh richvdh requested review from Hywan and removed request for a team May 22, 2024 12:37
update `ReadOnlyDevice::update_device` to return a bool indicating whether
anything is changing.
There is no need to emit a notification from `identities_stream` when all
devices are unchanged since last time.
@richvdh richvdh force-pushed the rav/no_device_update_on_unchanged branch from a7e7436 to 2a605de Compare May 22, 2024 12:43
@richvdh richvdh marked this pull request as draft May 22, 2024 12:52
Copy link

codecov bot commented May 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.26%. Comparing base (d7a8877) to head (818778c).
Report is 11 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3442      +/-   ##
==========================================
+ Coverage   83.23%   83.26%   +0.02%     
==========================================
  Files         247      247              
  Lines       25051    25055       +4     
==========================================
+ Hits        20851    20861      +10     
+ Misses       4200     4194       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This was untested before, and it seems the coverage gate is now sad.
@richvdh richvdh marked this pull request as ready for review May 22, 2024 16:23
Copy link
Member

@Hywan Hywan left a comment

Choose a reason for hiding this comment

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

I like the commits and the new code. Thanks for your work!

@Hywan Hywan merged commit c5f4168 into main May 23, 2024
49 of 58 checks passed
@Hywan Hywan deleted the rav/no_device_update_on_unchanged branch May 23, 2024 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

/keys/query loop in unverified sessions
2 participants