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(notification): add idempotency in notification api #162

Merged
merged 2 commits into from
Jan 12, 2023

Conversation

mabdh
Copy link
Member

@mabdh mabdh commented Dec 16, 2022

  • add a new idempotency table to track idempotencies
  • notify receiver API accepts optional idempotency-key header, if exists request is idempotent
  • add a job to clean up idempotencies data (by default 24h)
  • refactor some telemetries and cli

@mabdh mabdh force-pushed the notification-idempotency branch from 77988f6 to d1cb666 Compare December 16, 2022 08:21
@coveralls
Copy link

coveralls commented Dec 16, 2022

Pull Request Test Coverage Report for Build 3880296109

  • 119 of 149 (79.87%) changed or added relevant lines in 13 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.06%) to 77.418%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/store/postgres/receiver.go 0 1 0.0%
core/notification/handler.go 12 14 85.71%
internal/store/postgres/postgres.go 3 5 60.0%
internal/api/v1beta1/notification.go 27 30 90.0%
core/notification/service.go 28 38 73.68%
internal/store/postgres/idempotency.go 33 45 73.33%
Totals Coverage Status
Change from base Build 3880258452: -0.06%
Covered Lines: 2914
Relevant Lines: 3764

💛 - Coveralls

@ravisuhag ravisuhag linked an issue Dec 16, 2022 that may be closed by this pull request
@mabdh mabdh requested review from krtkvrm and rahmatrhd January 2, 2023 12:05
@mabdh mabdh marked this pull request as ready for review January 2, 2023 12:05
@krtkvrm
Copy link
Member

krtkvrm commented Jan 3, 2023

can you please add details on PR?

internal/api/header.go Outdated Show resolved Hide resolved
@mabdh mabdh requested review from ravisuhag and krtkvrm January 5, 2023 11:16
@mabdh mabdh force-pushed the notification-idempotency branch from 544fa2b to 6aeb6b5 Compare January 10, 2023 04:42
@mabdh mabdh force-pushed the notification-idempotency branch from 6aeb6b5 to 82c98ce Compare January 10, 2023 04:44
@mabdh mabdh merged commit 60bc6aa into main Jan 12, 2023
@mabdh mabdh deleted the notification-idempotency branch January 12, 2023 08:50
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.

Notification Source Idempotency
4 participants