Page MenuHomePhabricator

[lib] Move actualizedCalendarQuery into keyserver store
ClosedPublic

Authored by tomek on Feb 22 2024, 5:41 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, May 7, 6:04 PM
Unknown Object (File)
Tue, May 7, 4:48 AM
Unknown Object (File)
Mon, May 6, 12:12 PM
Unknown Object (File)
Apr 3 2024, 3:56 AM
Unknown Object (File)
Apr 2 2024, 10:41 PM
Unknown Object (File)
Mar 25 2024, 9:55 AM
Unknown Object (File)
Mar 8 2024, 3:26 AM
Unknown Object (File)
Mar 8 2024, 3:26 AM
Subscribers

Details

Summary

Move the filed to the store - this change means that we keep a separate value for each keyserver. This value includes only the filters from that keyserver.

https://linear.app/comm/issue/ENG-6901/move-actualizedcalendarquery-into-keyserver-store

Depends on D11135

Test Plan

Check if a migration succeeds on native and web - inspect Redux store after the migration and check if there are no inconsistencies reported.
Open a calendar, modify date range and check if the value is correctly updated in keyserver store.
Close and reopen the native app - there should be no inconsistency warning.
Log out and in, modify the dates - the store should be updated correctly.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tomek held this revision as a draft.

Fix some bugs and update test plan

tomek published this revision for review.Feb 22 2024, 6:08 AM
tomek added inline comments.
lib/reducers/keyserver-reducer.js
178–183 ↗(On Diff #37438)

In calendar-query-reducer we were filtering out the filters

...state,
      filters: removeKeyserverThreadIDsFromFilterList(state.filters, [
        action.payload.keyserverID,
      ]),

but here we know that all the thread filters are from this keyserver

242–245 ↗(On Diff #37438)

In calendar-query-reducer we weren't handling keyserverAuthActionTypes.success, but I think it makes sense to handle it

Fix tests by introducing a jest mock

You also need to remove actualizedCalendarQuery from states on web and native. And then from default states.

web/redux/action-types.js
95–99 ↗(On Diff #37441)

Where is this being handled now?

inka requested changes to this revision.Feb 22 2024, 7:14 AM
This revision now requires changes to proceed.Feb 22 2024, 7:14 AM
tomek marked an inline comment as done.

Update native state type
Use defaultCalendarQuery function in the default keyserver store
Handle actualizedCalendarQuery from an initial state in the reducer

web/redux/action-types.js
95–99 ↗(On Diff #37441)

Good question! We should keep this field in the initial state and handle it in the reducer.

Fix top-level default keyserver info - the app was crashing because config isn't registered when executing
top-level

kamil added inline comments.
web/redux/persist.js
360 ↗(On Diff #37518)

I think you should bump the version (both here and on native) and test it once more

This revision is now accepted and ready to land.Feb 26 2024, 2:32 AM

Tested native migration and deleted web migration - we aren't persisting actualizedCalendarQuery on web
and we don't need to migrate it - default state contains a new value.