-
Notifications
You must be signed in to change notification settings - Fork 325
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
[WPB-5990] Introduce user subsystem #3977
Conversation
acefa82
to
911774d
Compare
911774d
to
ec34fee
Compare
1dc3942
to
53a3f99
Compare
i started to pull this PR apart, more PRs with trivial, but noisy changes coming up! |
libs/wire-subsystems/test/unit/Wire/UserSubsystem/InterpreterSpec.hs
Outdated
Show resolved
Hide resolved
libs/wire-subsystems/test/unit/Wire/UserSubsystem/InterpreterSpec.hs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a general organisation question: why do we introduce these two effects: both Wire.UserStore
and Wire.UserSubsystem
? Shouldn't they be one effect instead?
this looks like an actual change in behavior, so we may want to fix this in the prod code, not in the tests. or not. maybe something about deleting expired users faster now than before? |
UserStore is a low-level persistence effect implemented in cassandra. UserSubsystem is a top-level effect that is implemented in terms of more fine-grained polysemy effects, one of them being UserStore. if we replace the UserStore implementation with something MVar-based, we can test UserSubsystem without the need for cassandra. if UserStore would happen internally in UserSubsystem.Interpreter, it would be unclear how to replace the cassandra interpreter in a robust way for the tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just some nitpicks, I guess, feel free to ignore :)
forall (c :: Component) f a m x fedM. | ||
(KnownComponent c, Foldable f) => | ||
f (Remote x) -> | ||
(Remote x -> fedM c a) -> | ||
FederationAPIAccess fedM m [Either (Remote x, FederationError) (Remote a)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pcapriotti now that we're porting this, have we thought about putting a concrete type here (i.e. []
)? passing dictionaries is expensive and Foldable
basically says "this is isomorphic to []
"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few things I believe have to be addressed. Comments are inlined.
'[ UserSubsystem, | ||
DeleteQueue, | ||
Error Wire.API.Federation.Error.FederationError, | ||
Wire.FederationAPIAccess.FederationAPIAccess Wire.API.Federation.Client.FederatorClient, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wire.FederationAPIAccess.FederationAPIAccess Wire.API.Federation.Client.FederatorClient, | |
FederationAPIAccess FederatorClient, |
I suppose we can import these things such that we can write the much shorter version.
never mind, this is actually happening in other branches, too. |
woooooooooooohooooooooooooo 🎉 |
https://wearezeta.atlassian.net/browse/WPB-5990
Checklist
changelog.d