fix(users): Online Users 'All time' filter returns empty (#28145) [1.12.9]#28209
Merged
Conversation
…28145) The /v1/users/online endpoint computed `now - timeWindow*60*1000` for the SQL threshold. When the UI sent `timeWindow=0` for the "All time" option, the threshold collapsed to `now`, producing `lastActivityTime > now` — which matched zero rows. Skip the time predicate entirely when `timeWindow <= 0` so the filter falls through to "all non-bot users". Reported via #27993.
Contributor
|
The Python checkstyle failed. Please run You can install the pre-commit hooks with |
Contributor
🔴 Playwright Results — 1 failure(s), 14 flaky✅ 2729 passed · ❌ 1 failed · 🟡 14 flaky · ⏭️ 95 skipped
Genuine Failures (failed on all attempts)❌
|
This file contains hidden or 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
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.
Cherry-pick of #28145 to 1.12.9.
Summary
Closes #27993 on the 1.12.9 release branch.
The
/v1/users/onlineendpoint computed the SQL threshold asnow - timeWindow*60*1000. When the UI senttimeWindow=0for the All time dropdown option, the threshold collapsed tonow, producinglastActivityTime > now— which matches zero rows. The page therefore rendered empty whenever a user selected All.The fix skips the time predicate entirely when
timeWindow <= 0, so the filter falls through to "all non-bot users".Conflict resolution
UserResourceIT.javaimport block — kept both the existingSubjectCache/SubjectContextimports (already on 1.12.9) and the newHttpMethod/RequestOptionsimports the new test needs.Test plan
mvn -pl openmetadata-service,openmetadata-integration-tests -am test-compilepasses locally