-
Notifications
You must be signed in to change notification settings - Fork 3k
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(metadata-io):Recently viewed, Recently Edited and Recently Searched section is missing in datahub home page #10234
Merged
david-leifker
merged 13 commits into
datahub-project:master
from
siladitya2:fix-recently-viewed
Apr 10, 2024
Merged
fix(metadata-io):Recently viewed, Recently Edited and Recently Searched section is missing in datahub home page #10234
david-leifker
merged 13 commits into
datahub-project:master
from
siladitya2:fix-recently-viewed
Apr 10, 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
…nto fix-recently-viewed
david-leifker
approved these changes
Apr 10, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks!
sleeperdeep
pushed a commit
to sleeperdeep/datahub
that referenced
this pull request
Jun 25, 2024
…ed section is missing in datahub home page (datahub-project#10234) Co-authored-by: si-chakraborty <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
community-contribution
PR or Issue raised by member(s) of DataHub Community
datahub-community-champion
PRs authored by DataHub Community Champions
product
PR or Issue related to the DataHub UI/UX
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.
Issue:
We currently observe that the Recently Viewed and Recently Edited section is missing on datahub home page.
Also, Recently Searches section is missing on search bar
Root cause:
When the
SearchRequest
for Recently Viewed/Edited or Searched item is build then instead of considering theSession User
,System User
is used in theSearchRequest
asactorUrn
.Example
SearchRequest
of Recently Viewed from my local debug log:SearchRequest{searchType=QUERY_THEN_FETCH, indices=[datahub_usage_event], indicesOptions=IndicesOptions[ignore_unavailable=false, allow_no_indices=true, expand_wildcards_open=true, expand_wildcards_closed=false, expand_wildcards_hidden=false, allow_aliases_to_multiple_indices=true, forbid_closed_indices=true, ignore_aliases=false, ignore_throttled=true], routing='null', preference='null', requestCache=null, scroll=null, maxConcurrentShardRequests=0, batchedReduceSize=512, preFilterShardSize=null, allowPartialSearchResults=null, localClusterAlias=null, getOrCreateAbsoluteStartMillis=-1, ccsMinimizeRoundtrips=true, source={"size":0,"query":{"bool":{"must":[{"term":{"actorUrn.keyword":{"value":"urn:li:corpuser:__datahub_system","boost":1.0}}},{"term":{"type":{"value":"EntityViewEvent","boost":1.0}}}],"adjust_pure_negative":true,"boost":1.0}},"aggregations":{"entity":{"terms":{"field":"entityUrn.keyword","size":5,"min_doc_count":1,"shard_min_doc_count":0,"show_term_doc_count_error":false,"order":[{"last_viewed":"desc"},{"_key":"asc"}]},"aggregations":{"last_viewed":{"max":{"field":"timestamp"}}}}}}, cancelAfterTimeInterval=null, pipeline=null}
Response:
{"took":12,"timed_out":false,"_shards":{"total":1,"successful":1,"skipped":0,"failed":0},"hits":{"total":{"value":0,"relation":"eq"},"max_score":null,"hits":[]},"aggregations":{"sterms#entity":{"doc_count_error_upper_bound":0,"sum_other_doc_count":0,"buckets":[]}}}
If you observe the
SearchRequest
above, instead of using the Session User(urn:li:corpuser:[email protected]
) it is building theSearchRequest
with the System User:urn:li:corpuser:__datahub_system
.That's why the response of this
SearchRequest
does not contain any data.Fix:
Use the user from the getSessionActorContext() while building the
SearchRequest
for Recently Viewed, Edited and Searched items.Test result:
![Screenshot 2024-04-09 at 12 00 31](https://private-user-images.githubusercontent.com/68184387/320808087-fec21a51-2c70-4274-b6dc-586267f24dae.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5MzA4OTgsIm5iZiI6MTczOTkzMDU5OCwicGF0aCI6Ii82ODE4NDM4Ny8zMjA4MDgwODctZmVjMjFhNTEtMmM3MC00Mjc0LWI2ZGMtNTg2MjY3ZjI0ZGFlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE5VDAyMDMxOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWMyZTdjYTgzOTA1NjJiOWY0YTAzMDIzODg0MWI4NDgyYjU4Y2RmMGM1NTU1ODkxNjc1M2M5M2FiYTYzNGMxNDQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.HTCm6dx1Rjed-mEVUzMhsuOS05TQfto-8wcqIcRNT1I)
![Screenshot 2024-04-10 at 18 19 44](https://private-user-images.githubusercontent.com/68184387/321316430-f4259b1a-787f-4db4-ae81-b57ccb5e48c9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5MzA4OTgsIm5iZiI6MTczOTkzMDU5OCwicGF0aCI6Ii82ODE4NDM4Ny8zMjEzMTY0MzAtZjQyNTliMWEtNzg3Zi00ZGI0LWFlODEtYjU3Y2NiNWU0OGM5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE5VDAyMDMxOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk0YzQxODEyNmE0M2E0NjNiMTVmNDgxOGNiNTZjZDlkMDRlOTUwODY0NzcxM2ZjNGJhNTEwYjFmNWVmMzgzMWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Mt0Cahkq7lJYQ60mGp5M4zURYKufYaLOW35Nmn9-8xs)
UI Screen shot from my local after applying the fix.
Note:
This issue could be fixed an alternate way like below(
SpringQueryContext.java
)this.operationContext = OperationContext.asSession(systemOperationContext, authorizer, authentication, false);
but which seems to be a contradictory of this PR
@david-leifker could you please review and provide your thought on this?
Checklist