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

indexeddb: fix bugs in serialization improvement #3651

Merged
merged 7 commits into from
Jul 5, 2024

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Jul 3, 2024

There were two problems in #3645, resulting in element-hq/element-web#27666.

  • It turns out that JsValue::into_serde and serde_wasm_bindgen::from_value do different things.
  • We didn't correctly handle arrays and strings in the old encoding format. We can fix arrays easily but strings are a little harder. Fortunately there is only one of those and we can force a migration to the new format.

Apologies for the not-great commits in this PR. I needed to get a release out in a hurry to fix the issue.

…om_value`

Turns out that `serde_wasm_bindgen` isn't happy with some input. Haven't
figured out why, yet.
Turns out legacy unencrypted objects can take many forms, and we need to be
tolerant of them.

Also expose `deserialize_legacy_value` as a separate function, because we're
going to need to special-case it.
The name was stupid, and this was the only string that was stored in the legacy
format; we can fix both problems with a cheeky migration.
@richvdh richvdh marked this pull request as ready for review July 4, 2024 08:05
@richvdh richvdh requested a review from a team as a code owner July 4, 2024 08:05
@richvdh richvdh requested review from poljar and removed request for a team July 4, 2024 08:05
@richvdh richvdh force-pushed the rav/indexeddb_storage_efficiency_fix_bugs branch from 6885c4e to 98e9abd Compare July 4, 2024 08:10
Copy link

codecov bot commented Jul 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.25%. Comparing base (d6300bb) to head (fac7221).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3651      +/-   ##
==========================================
- Coverage   84.27%   84.25%   -0.02%     
==========================================
  Files         259      259              
  Lines       26622    26622              
==========================================
- Hits        22435    22431       -4     
- Misses       4187     4191       +4     

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

@richvdh richvdh enabled auto-merge July 5, 2024 09:29
@richvdh richvdh merged commit f9a19c5 into main Jul 5, 2024
40 checks passed
@richvdh richvdh deleted the rav/indexeddb_storage_efficiency_fix_bugs branch July 5, 2024 09:43
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.

2 participants