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: shared events duplication #1197

Merged
merged 1 commit into from
Dec 19, 2024
Merged

Conversation

abdullai-t
Copy link
Contributor

@abdullai-t abdullai-t commented Dec 19, 2024

Summary / Highlights

This PR fixes the duplication of shared events on the admin portal.

When retrieving events visible to a community admin, the backend was fetching all events created by the admin's community as well as those shared with the admin's community. This led to duplication because the concatenation of these two sets of events did not enforce uniqueness.

The changes implemented in this PR ensure that only unique events are displayed to the community admin by calling .distinct() on the final events set.

Details (Give details about what this PR accomplishes, include any screenshots etc)

Testing Steps (Provide details on how your changes can be tested)

Requirements (place an x in each [ ])

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've tested my changes manually.
  • I've added unit tests to my PR.
Transparency (Project board)
  • I've given my PR a meaningful title.
  • I linked this PR to the relevant issue.
  • I moved the linked issue from the "Sprint backlog" to "In progress" when I started this.
  • I moved the linked issue to "QA Verification" now that it is ready to merge.

- Modified the return statement in the EventStore class to ensure that the events returned are distinct, improving data integrity and reducing duplicates in the event list.
@abdullai-t abdullai-t changed the title Refactor: Update event retrieval to return distinct events Fix: shared events duplication Dec 19, 2024
Copy link

codecov bot commented Dec 19, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 58.76%. Comparing base (b64feba) to head (b837633).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/api/store/event.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1197      +/-   ##
==========================================
- Coverage   58.77%   58.76%   -0.02%     
==========================================
  Files         501      501              
  Lines       37364    37364              
==========================================
- Hits        21961    21956       -5     
- Misses      15403    15408       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@frimpongopoku frimpongopoku left a comment

Choose a reason for hiding this comment

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

LGTM

@abdullai-t abdullai-t merged commit 28a4c51 into main Dec 19, 2024
1 of 3 checks passed
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.

3 participants