Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[MergeDups] Implement SignalRHub for duplicate finder#3725

Merged
imnasnainaec merged 21 commits into
masterfrom
merge-dups-hub
Apr 28, 2025
Merged

[MergeDups] Implement SignalRHub for duplicate finder#3725
imnasnainaec merged 21 commits into
masterfrom
merge-dups-hub

Conversation

@imnasnainaec

@imnasnainaec imnasnainaec commented Apr 16, 2025

Copy link
Copy Markdown
Collaborator

Resolves #3720


This change is Reviewable

@codecov

codecov Bot commented Apr 16, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 25.58140% with 64 lines in your changes missing coverage. Please review.

Project coverage is 72.81%. Comparing base (1a241ca) to head (0320fb9).
Report is 20 commits behind head on master.

Files with missing lines Patch % Lines
Backend/Controllers/MergeController.cs 15.78% 16 Missing ⚠️
Backend/Services/MergeService.cs 11.76% 15 Missing ⚠️
src/components/App/SignalRHub.tsx 0.00% 15 Missing ⚠️
src/goals/MergeDuplicates/MergeHub.tsx 0.00% 8 Missing ⚠️
src/goals/Redux/GoalActions.ts 66.66% 4 Missing and 2 partials ⚠️
src/components/ProjectExport/ExportHub.tsx 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3725      +/-   ##
==========================================
- Coverage   73.12%   72.81%   -0.31%     
==========================================
  Files         285      287       +2     
  Lines       10648    10707      +59     
  Branches     1328     1334       +6     
==========================================
+ Hits         7786     7796      +10     
- Misses       2467     2514      +47     
- Partials      395      397       +2     
Flag Coverage Δ
backend 81.83% <20.51%> (-0.54%) ⬇️
frontend 65.75% <29.78%> (-0.16%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@imnasnainaec imnasnainaec marked this pull request as ready for review April 21, 2025 20:59

@jasonleenaylor jasonleenaylor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you should investigate memory cache as an alternative to the ConcurrentDictionary.
https://learn.microsoft.com/en-us/dotnet/api/system.runtime.caching.memorycache?view=netframework-4.8

Reviewed 3 of 23 files at r1, 7 of 12 files at r4.
Reviewable status: 9 of 27 files reviewed, all discussions resolved (waiting on @imnasnainaec)

@imnasnainaec imnasnainaec marked this pull request as draft April 22, 2025 19:20
@imnasnainaec imnasnainaec marked this pull request as ready for review April 23, 2025 22:24
Comment thread Backend/Controllers/MergeController.cs Outdated
internal async Task<bool> GetDuplicatesThenSignal(string projectId, int maxInList, int maxLists, string userId)
{
// Use counter to ensure that only the most recent duplicate request succeeds per user.
var counter = Interlocked.Increment(ref _mergeCounter);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

it's not clear to me, is there an assumption that _mergeCounter is persisted between requests? I would verify this as I believe by default controllers are request scoped and not singletons meaning each request _mergeCounter would start at 0.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Oh, good catch, thank you. Yes, it does need to be persisted, so I'll move that counter into the now-singleton Merge Service.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done

@imnasnainaec imnasnainaec marked this pull request as draft April 24, 2025 12:54

@imnasnainaec imnasnainaec left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

(Investigated and discussed elsewhere.)

Reviewable status: 9 of 27 files reviewed, 1 unresolved discussion (waiting on @hahn-kev, @imnasnainaec, and @jasonleenaylor)

Comment thread Backend/Controllers/MergeController.cs Outdated
internal async Task<bool> GetDuplicatesThenSignal(string projectId, int maxInList, int maxLists, string userId)
{
// Use counter to ensure that only the most recent duplicate request succeeds per user.
var counter = Interlocked.Increment(ref _mergeCounter);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Oh, good catch, thank you. Yes, it does need to be persisted, so I'll move that counter into the now-singleton Merge Service.

@imnasnainaec imnasnainaec marked this pull request as ready for review April 24, 2025 13:41

@imnasnainaec imnasnainaec left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reviewable status: 8 of 27 files reviewed, 1 unresolved discussion (waiting on @hahn-kev and @jasonleenaylor)

Comment thread Backend/Controllers/MergeController.cs Outdated
internal async Task<bool> GetDuplicatesThenSignal(string projectId, int maxInList, int maxLists, string userId)
{
// Use counter to ensure that only the most recent duplicate request succeeds per user.
var counter = Interlocked.Increment(ref _mergeCounter);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done

@jasonleenaylor jasonleenaylor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed 11 of 22 files at r2, 1 of 3 files at r3, 4 of 12 files at r4, 3 of 3 files at r6, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @hahn-kev)

@imnasnainaec imnasnainaec left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Dismissed @hahn-kev from a discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @hahn-kev)

@imnasnainaec imnasnainaec merged commit 4e22884 into master Apr 28, 2025
@imnasnainaec imnasnainaec deleted the merge-dups-hub branch April 28, 2025 12:48
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.

MergeDuplicate errors (524) if duplicate-finding takes longer than 100 seconds

3 participants