Page MenuHomePhabricator

[lib] Fix circular dependency
ClosedPublic

Authored by michal on May 8 2023, 10:32 AM.
Tags
None
Referenced Files
Unknown Object (File)
Apr 13 2024, 2:02 AM
Unknown Object (File)
Apr 9 2024, 2:42 AM
Unknown Object (File)
Apr 9 2024, 2:42 AM
Unknown Object (File)
Apr 9 2024, 2:42 AM
Unknown Object (File)
Apr 3 2024, 5:53 PM
Unknown Object (File)
Feb 27 2024, 8:35 AM
Unknown Object (File)
Feb 18 2024, 6:54 PM
Unknown Object (File)
Feb 18 2024, 4:08 PM
Subscribers

Details

Summary

Should fix ENG-3840 (landing not working). The issue was a circular dependecy after adding validators. Moves session related functions out of account-utils and into session-utils

Test Plan

Check if web and landing work.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ginsu requested changes to this revision.May 8 2023, 10:56 AM

The code looks good, but I actually pitched this idea to @ashoat initially and we talked about finding another solution. Thinking out lout right now, but wouldn't it be possible to decouple this cycle by moving defaultNotificationPayloadValidator out of account-types and possibly into validation-utils? I think this would also be better since there are no other validators in account-utils and account-utils should exclusively just be for types

This revision now requires changes to proceed.May 8 2023, 10:56 AM

My high-level view is that it would be better to keep account-utils.js as a "leaf", and just extract the one function that is preventing account-utils.js from being a leaf, than to extract all of the other stuff into a new leaf

Instead of extracting the regexes, instead move the session functions. Only invalidSessionRecovery had to be moved but I moved both of them to keep them together, I can move invalidSessionDowngrade back if that's prefered.

defaultNotificationPayloadValidator out of account-types and possibly into validation-utils

I would prefer to keep as much validators near their flow definitions so people don't change one without changing the other

michal retitled this revision from [lib] Extract regexes from account-utils to [lib] Fix circular dependency.May 9 2023, 2:22 AM
michal edited the summary of this revision. (Show Details)

lgtm thanks for fixing this!

Only invalidSessionRecovery had to be moved but I moved both of them to keep them together,

this makes sense

This revision is now accepted and ready to land.May 9 2023, 3:01 AM