Skip to content

add appropriate eventId on update, correction, and creation #3064

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Courey
Copy link
Contributor

@Courey Courey commented Apr 24, 2025

Description

This update makes it so that the eventId is included automatically on update, create, and correction even if not included. The different options for the correction are complex, so I created an additional function that determines the desired eventId depending on input.

That priority is:

  • if the circular id and the eventId parsed from the subject AND the correction eventId is not the same as the circular's eventId, the correction eventId is the desired.
  • if there is no eventId on the original circular and the eventId being passed in is different than what it would be if it was parsed from the subject, the eventId being passed in is the desired one. This allows moderators to put an eventId on the circular that doesn't come from the subject being parsed.
  • if there is not an eventId on the original circular and there is not an eventId being passed in, it will attempt to parse the subject for an eventId and will use that.
  • if the original circular's eventId is the same as the eventId on the correction request (which will happen if there was an eventId originally and no change was entered), then we see if the parsed subject is different. If so, we update the eventId based on the parsed value. This is so that when there is a correction submitted that changes the subject to a valid subject matcher match, the eventId will automatically be added.
  • and finally, as a default case, we side with the submitted correction's eventId

Related Issue(s)

Resolves #3063

Testing

This was tested locally.
I also added unit tests for the cases I could think of.

@Courey Courey requested review from lpsinger and dakota002 April 24, 2025 19:39
Copy link

codecov bot commented Apr 24, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 9 lines in your changes missing coverage. Please review.

Project coverage is 6.69%. Comparing base (b38696d) to head (9c4607c).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
app/routes/circulars/circulars.lib.ts 69.23% 2 Missing and 2 partials ⚠️
app/routes/circulars._archive._index/route.tsx 0.00% 3 Missing ⚠️
app/routes/circulars/circulars.server.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main   #3064      +/-   ##
========================================
+ Coverage   6.51%   6.69%   +0.17%     
========================================
  Files        179     179              
  Lines       4422    4438      +16     
  Branches     486     493       +7     
========================================
+ Hits         288     297       +9     
- Misses      4132    4137       +5     
- Partials       2       4       +2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Courey Courey force-pushed the courey/update_event_id_on_change_request branch from 455187c to 6913f12 Compare May 30, 2025 15:21
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.

update eventId automatically on correction or edit
2 participants