Skip to content

Conversation

@n1k0
Copy link
Member

@n1k0 n1k0 commented Feb 2, 2026

🔧 Problem

This patch:

🚨 Points to watch/comments

Contrary to the initial impl. in #1694, this one is non-destructive, meaning there won't be a session reset nor emptying the list of existing bookmarks for end users when deployed to production.

The patch introduces a new separate localStorage key for the ongoing version (ecobalyse) and leaves untouched the previous one (store); while it's a bit sad to have those two stores, the UX is better and safer for end users and I think that's what matters most.

🧐 How to test

  • Switch from current to regulatory version and vice-versa multiple times: your version-compatible bookmarks should always be retrieved everytime, no data loss, ever
  • Tweak your serialized JSON data in localStorage to create an invalid bookmark (pick one from the tests added in the diff) and refresh the page: your authentication status should be preserved, only the forged invalid bookmarks should have been dropped from the list.
  • You could also get your JSON localStorage data from production and paste it in the localStorage of the PR to see how much non-destructive it is 😅

@n1k0 n1k0 changed the title fix(ui): fix losing session data when navigating different versions (… fix(ui): fix losing session data when navigating different versions Feb 2, 2026
@n1k0 n1k0 force-pushed the feat/reapply-localstorage-fix branch from 92ae4be to 20481be Compare February 2, 2026 17:12
@n1k0 n1k0 force-pushed the feat/reapply-localstorage-fix branch from c31fcf1 to d9ba8af Compare February 3, 2026 08:41
@n1k0
Copy link
Member Author

n1k0 commented Feb 3, 2026

Hmm hold on reviewing, I spotted a last mistake to fix

@n1k0 n1k0 requested review from vjousse and removed request for camcoq-start, cedricr and vjousse February 3, 2026 10:33
@n1k0
Copy link
Member Author

n1k0 commented Feb 3, 2026

@vjousse this is back to ready for review… not super proud of the solution to have both app versions living on the same domain by using two distinct store keys, but backporting all this elm code to stable/textile was too complicated and cumbersome so I don't think it's worth doing. Tell me what you think :)

@n1k0 n1k0 requested a review from camcoq-start February 3, 2026 13:58
@n1k0 n1k0 force-pushed the feat/reapply-localstorage-fix branch from b589b5d to 86dc0fa Compare February 3, 2026 15:32
@n1k0 n1k0 force-pushed the feat/reapply-localstorage-fix branch from 86dc0fa to bb430aa Compare February 4, 2026 10:14
Copy link
Collaborator

@vjousse vjousse left a comment

Choose a reason for hiding this comment

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

Tested locally, with valid and invalid JSON: works as expected, god job! Are we sure we want to keep invalid bookmarks in the local storage when we detect one? Shouldn’t we delete the invalid entry from the storage?

@n1k0
Copy link
Member Author

n1k0 commented Feb 4, 2026

Are we sure we want to keep invalid bookmarks in the local storage when we detect one? Shouldn’t we delete the invalid entry from the storage?

We actually have to keep them because they may be valid in another version (a valid v7 one is invalid in ongoing version and the other way around)

Edit: Oh, you mean now we have distinct stores, it doesn't matter anymore and we should garbage collect them? That makes sense, thanks for the feedback 🙏

@vjousse
Copy link
Collaborator

vjousse commented Feb 4, 2026

Yes indeed, that’s what I was talking about!

@n1k0 n1k0 requested a review from vjousse February 4, 2026 11:29
@n1k0
Copy link
Member Author

n1k0 commented Feb 4, 2026

@vjousse implemented the change in 21eeffc, would you mind checking it again? 🙏

@vjousse
Copy link
Collaborator

vjousse commented Feb 4, 2026

It looks like I still have the 3 entries in the local storage even if one is invalid
260204_13-18-32

@n1k0
Copy link
Member Author

n1k0 commented Feb 4, 2026

It looks like I still have the 3 entries in the local storage even if one is invalid

@vjousse that's because you're testing the v7 regulatory version, which I can't patch as previously stated… the filtering of invalid bookmarks is only implemented for master. Or do you observe this behavior on the ongoing version as well?

@n1k0
Copy link
Member Author

n1k0 commented Feb 4, 2026

@vjousse Oh I see the ecobalyse key name in your capture… I think you need to perform at list a first bookmark update — eg. renaming one — in order for the reencoding, filtering and saving to happen. Could you please try? 🙏

Edit: tested this myself, it's indeed because you have to perform an update to the session for the filtering to be performed and persisted.

@vjousse
Copy link
Collaborator

vjousse commented Feb 4, 2026

Indeed, with an update of the bookmarks, it works as expected 🎉

Copy link
Collaborator

@vjousse vjousse left a comment

Choose a reason for hiding this comment

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

LGTM!

@n1k0 n1k0 merged commit 577fe94 into master Feb 4, 2026
7 checks passed
@n1k0 n1k0 deleted the feat/reapply-localstorage-fix branch February 4, 2026 13:14
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.

Perte des bookmarks lorsqu'on passe de la v7 à la dernière version

2 participants