-
Notifications
You must be signed in to change notification settings - Fork 13k
fix(apps): prevent greedy update via apps #35120
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
Conversation
|
Looks like this PR is ready to merge! 🎉 |
🦋 Changeset detectedLatest commit: 3d1c334 The changes in this PR will be included in the next version bump. This PR includes changesets to release 38 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #35120 +/- ##
===========================================
+ Coverage 59.45% 59.46% +0.01%
===========================================
Files 2828 2829 +1
Lines 68159 68290 +131
Branches 15124 15124
===========================================
+ Hits 40521 40606 +85
- Misses 24982 25028 +46
Partials 2656 2656
Flags with carried forward coverage won't be shown. Click here to find out more. |
0c68a4d to
dd802e2
Compare
040628e to
48978a6
Compare
Proposed changes (including videos or screenshots)
When apps update an entity (a room or a message) via their respective
ModifyUpdatermethod, the bridge will actually update ALL fields of in the DB record. That is because it uses a$setinstruction with the whole record sent by the app. This creates a problem where the app could have queried stale data and would inadvertedly overwrite the previously updated DB record with such stale data.To prevent this scenario, this PR modifies the builder instances used by the updaters,
RoomBuilderandMessageBuilder, to actually keep track of the changes applied by the app, and send only the changed properties to be updated in the bridge.Issue(s)
CONN-480
Steps to test or reproduce
Further comments