-
-
Notifications
You must be signed in to change notification settings - Fork 277
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
Feature/slotted counts #2074
Merged
acelaya
merged 19 commits into
shlinkio:develop
from
acelaya-forks:feature/slotted-counts
Mar 28, 2024
Merged
Feature/slotted counts #2074
acelaya
merged 19 commits into
shlinkio:develop
from
acelaya-forks:feature/slotted-counts
Mar 28, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
acelaya
force-pushed
the
feature/slotted-counts
branch
from
March 27, 2024 18:08
4ea8271
to
cef30c8
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2074 +/- ##
=============================================
- Coverage 97.35% 97.30% -0.06%
- Complexity 1343 1357 +14
=============================================
Files 250 252 +2
Lines 4772 4852 +80
=============================================
+ Hits 4646 4721 +75
- Misses 126 131 +5 ☔ View full report in Codecov by Sentry. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #2036
TODO
Visits count is tracked via apreFlush
event listener. This is usually fine as long as the short URL existed before the visit, but in certain cases this is not true, like in tests, where we have to remember flushing short URLs before visits, or when importing short URLs.This can be solved by using a combination of
onFlush
to track the entities to be created +postFlush
, where those will have IDs. For some reason, when I first checked this I oversaw the existence of these events.Try to find a native way to do upserts in MS SQL and SQLite which does not require a select followed by an insert or update.I tried using a
MERGE
statement, but it ended up running un race conditions with duplicate keys due to not properly locking rows. See https://www.mssqltips.com/sqlservertip/3074/use-caution-with-sql-servers-merge-statement/?utm_source=AaronBertrandExisting SELECT then INSERT or UPDATE approach works better.
Sometimes API test covering short URLs lists fail when ordering by title.This is already happening with non-postgres engines in
develop
branch. It was just found at this moment because I tried to run API tests with the other engines.ShortUrlVisitsCountTracker
Next steps
ShortUrlVisitsCountTracker