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

feat(notifications_push_repository): Init #2482

Merged
merged 3 commits into from
Sep 29, 2024

Conversation

provokateurin
Copy link
Member

@provokateurin provokateurin commented Sep 12, 2024

#577
Depends on #2407 (due to an ugly cyclic dependency)

The framework part can probably be improved, but I just wanted to put out the repository so it can get reviewed.

The repository now handles all possible things that could go wrong and retries registering at UnifiedPush or Nextcloud if necessary. This should make push notifications super reliable and usable.

@provokateurin
Copy link
Member Author

Also makes it possible to implement #213 later.

@provokateurin provokateurin force-pushed the feat/notifications_push_repository branch 2 times, most recently from d3ef216 to 7d16bc0 Compare September 12, 2024 07:38
@Leptopoda
Copy link
Member

Should we land the repository and the migration changes in separate PRs?
Maybe we can land both into a temporary branch that we then merge once both are reviewed.

Both commits are already huge to begin with.

@provokateurin
Copy link
Member Author

Hm if we only have 2 PRs I'd say just merge the repository into main and then later the refactor.
A special branch is not really necessary as there are no incremental changes that need to be merged together into main (the repository is standalone after all).

@provokateurin provokateurin force-pushed the feat/notifications_push_repository branch from 7d16bc0 to e8880db Compare September 12, 2024 10:33
@provokateurin
Copy link
Member Author

I removed the framework commit and pushed it to a separate branch. Once merged I'll open a new PR for that.

@provokateurin provokateurin force-pushed the feat/notifications_push_repository branch from e8880db to fad21d1 Compare September 12, 2024 11:24
@provokateurin
Copy link
Member Author

I rebased this, but while testing I found an error with the push subscription registration.
You can already review this, but I will have to look the problem so expect some (hopefully minor) changes.

@provokateurin provokateurin force-pushed the feat/notifications_push_repository branch from fad21d1 to 7ec5abb Compare September 13, 2024 04:38
Copy link

codecov bot commented Sep 13, 2024

Codecov Report

Attention: Patch coverage is 96.78899% with 7 lines in your changes missing coverage. Please review.

Project coverage is 28.66%. Comparing base (5714554) to head (29f6a4b).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...es/neon_framework/lib/src/storage/persistence.dart 0.00% 2 Missing ⚠️
...neon_framework/lib/src/storage/settings_store.dart 0.00% 2 Missing ⚠️
...repository/lib/src/models/push_subscription.g.dart 96.72% 2 Missing ⚠️
...ository/lib/src/notifications_push_repository.dart 98.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2482      +/-   ##
==========================================
+ Coverage   28.56%   28.66%   +0.10%     
==========================================
  Files         359      366       +7     
  Lines      136078   136296     +218     
==========================================
+ Hits        38865    39076     +211     
- Misses      97213    97220       +7     
Flag Coverage Δ *Carryforward flag
account_repository 98.76% <ø> (ø)
cookie_store 99.48% <ø> (ø) Carriedforward from 5714554
dashboard_app 96.05% <ø> (ø)
dynamite 31.05% <ø> (ø) Carriedforward from 5714554
dynamite_end_to_end_test 61.69% <ø> (ø) Carriedforward from 5714554
dynamite_runtime 85.40% <ø> (ø) Carriedforward from 5714554
interceptor_http_client 97.18% <ø> (ø) Carriedforward from 5714554
neon_dashboard 96.05% <ø> (ø) Carriedforward from 5714554
neon_framework 59.20% <0.00%> (-0.07%) ⬇️
neon_http_client 97.50% <ø> (ø) Carriedforward from 5714554
neon_notifications 100.00% <ø> (ø) Carriedforward from 5714554
neon_storage 94.66% <ø> (ø) Carriedforward from 5714554
neon_talk 99.45% <ø> (ø) Carriedforward from 5714554
nextcloud 24.26% <ø> (ø) Carriedforward from 5714554
notifications_app 97.40% <ø> (ø)
notifications_push_repository 98.59% <98.59%> (?)
sort_box 90.90% <ø> (ø) Carriedforward from 5714554
talk_app 98.94% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
packages/neon_framework/lib/src/testing/mocks.dart 92.30% <ø> (ø)
...h_repository/lib/src/models/push_subscription.dart 100.00% <100.00%> (ø)
...repository/lib/src/notifications_push_storage.dart 100.00% <100.00%> (ø)
...ory/lib/src/testing/testing_push_notification.dart 100.00% <100.00%> (ø)
...ory/lib/src/testing/testing_push_subscription.dart 100.00% <100.00%> (ø)
...ions_push_repository/lib/src/utils/encryption.dart 100.00% <100.00%> (ø)
...ository/lib/src/notifications_push_repository.dart 98.88% <98.88%> (ø)
...es/neon_framework/lib/src/storage/persistence.dart 71.42% <0.00%> (-28.58%) ⬇️
...neon_framework/lib/src/storage/settings_store.dart 84.61% <0.00%> (-15.39%) ⬇️
...repository/lib/src/models/push_subscription.g.dart 96.72% <96.72%> (ø)

Copy link
Member

@Leptopoda Leptopoda left a comment

Choose a reason for hiding this comment

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

Thanks for the work.
I'm not a big fan of the code style in the repo.
Many methods in there do not take any parameters and rely on the global state of the repo. I've already outlined most of my concerns, and maybe fixing them is enough.

@provokateurin provokateurin force-pushed the feat/notifications_push_repository branch from 7ec5abb to 4d72c86 Compare September 23, 2024 14:11
@provokateurin provokateurin marked this pull request as ready for review September 23, 2024 14:12
@provokateurin provokateurin force-pushed the feat/notifications_push_repository branch from 4d72c86 to 80071e4 Compare September 29, 2024 09:47
@provokateurin provokateurin force-pushed the feat/notifications_push_repository branch from 80071e4 to 29f6a4b Compare September 29, 2024 09:48
@provokateurin provokateurin merged commit 8b905a0 into main Sep 29, 2024
10 checks passed
@provokateurin provokateurin deleted the feat/notifications_push_repository branch September 29, 2024 10:02
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.

2 participants