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

fix(GODT-1757): Refactor code to have better data separation #91

Merged
merged 3 commits into from
Sep 1, 2022

Conversation

LBeernaertProton
Copy link
Contributor

Due to Go's lackluster import system we had to refactor certain types
into separate packages so we can better control what each type has
access to.

All the database related code has been moved into the db package.

All the remote user management code has been been moved into the remote
package. Existing remote code has been erased.

All things related to state and snapshot have been moved into the state
package.

To avoid cyclic imports, the state package declares two interfaces which
provide access to some user specific data as well as a custom connector
implementation on which metadata can be attached.

@LBeernaertProton LBeernaertProton force-pushed the fix/GODT-1757-improve-data-separation branch 2 times, most recently from 37a99ce to 1131c08 Compare August 31, 2022 12:48
Due to Go's lackluster import system we had to refactor certain types
into separate packages so we can better control what each type has
access to.

All the database related code has been moved into the db package.

All the remote user management code has been been moved into the remote
package. Existing remote code has been erased.

All things related to state and snapshot have been moved into the state
package.

To avoid cyclic imports, the state package declares two interfaces which
provide access to some user specific data as well as a custom connector
implementation on which metadata can be attached.
@LBeernaertProton LBeernaertProton force-pushed the fix/GODT-1757-improve-data-separation branch from 1131c08 to 764ffe8 Compare August 31, 2022 13:08
Cleanup the code by remove the apply functions from the user interface.
Common code has been put under update_mailbox.go and each separate
implementation is charged with pushing the updates.

Thanks to this, all the user's connector updates can just be queued as
the code is no longer shared between states and user.
@LBeernaertProton LBeernaertProton enabled auto-merge (squash) August 31, 2022 13:43
tests/run_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@jameshoulahan jameshoulahan left a comment

Choose a reason for hiding this comment

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

All good, just would remove a couple bits of dead code, and you were a bit heavy-handed with the find-replace :)

@LBeernaertProton LBeernaertProton merged commit 86b442b into dev Sep 1, 2022
@LBeernaertProton LBeernaertProton deleted the fix/GODT-1757-improve-data-separation branch September 1, 2022 07:35
@github-actions
Copy link

github-actions bot commented Sep 2, 2022

🎉 This PR is included in version 0.11.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants