Skip to content

refactor: No longer set timeline event as state event#2358

Open
krille-chan wants to merge 1 commit into
mainfrom
krille/no-longer-set-timeline-event-as-state
Open

refactor: No longer set timeline event as state event#2358
krille-chan wants to merge 1 commit into
mainfrom
krille/no-longer-set-timeline-event-as-state

Conversation

@krille-chan
Copy link
Copy Markdown
Contributor

We did this in the past to store the lastEvent but we now have a dedicated slot in our Room JSON structure for the persistent storage.

We did this in the past to store the
lastEvent but we now have a dedicated
slot in our Room JSON structure for
the persistent storage.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d94e9dbd-ad98-4d68-896f-3123c39a03ea

📥 Commits

Reviewing files that changed from the base of the PR and between 8a9a2fa and d391e52.

📒 Files selected for processing (1)
  • lib/encryption/encryption.dart
💤 Files with no reviewable changes (1)
  • lib/encryption/encryption.dart

📝 Walkthrough

Walkthrough

The decryptRoomEvent method in the encryption module no longer calls event.room.setState(event) before persisting decrypted event updates. The conditional branch that performed this room state update has been removed, and the method now proceeds directly to database persistence operations.

Changes

Event Decryption

Layer / File(s) Summary
Remove room state update from event decryption
lib/encryption/encryption.dart
The conditional call to event.room.setState(event) executed when updateType != EventUpdateType.history was removed from decryptRoomEvent. Room state is no longer updated at this point during decrypted event handling.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: removing the conditional state update call in decryptRoomEvent, which aligns with no longer setting timeline events as state events.
Description check ✅ Passed The description is directly related to the changeset, explaining the rationale behind removing the state event update by noting a dedicated Room JSON structure now exists for persistent storage.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch krille/no-longer-set-timeline-event-as-state

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.27%. Comparing base (8a9a2fa) to head (d391e52).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2358   +/-   ##
=======================================
  Coverage   59.26%   59.27%           
=======================================
  Files         161      161           
  Lines       20061    20059    -2     
=======================================
  Hits        11889    11889           
+ Misses       8172     8170    -2     
Files with missing lines Coverage Δ
lib/encryption/encryption.dart 84.65% <ø> (+0.95%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8a9a2fa...d391e52. Read the comment docs.

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.

1 participant