Skip to content
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
merged 13 commits into from
Apr 10, 2024

Conversation

siladitya2
Copy link
Contributor

@siladitya2 siladitya2 commented Apr 8, 2024

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

Screenshot 2024-04-09 at 15 03 56

Root cause:

When the SearchRequest for Recently Viewed/Edited or Searched item is build then instead of considering the Session User,System User is used in the SearchRequest as actorUrn.

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 the SearchRequest 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:
UI Screen shot from my local after applying the fix.
Screenshot 2024-04-09 at 12 00 31
Screenshot 2024-04-10 at 18 19 44

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

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@github-actions github-actions bot added product PR or Issue related to the DataHub UI/UX community-contribution PR or Issue raised by member(s) of DataHub Community datahub-community-champion PRs authored by DataHub Community Champions labels Apr 8, 2024
@siladitya2 siladitya2 changed the title fix(metadata-io):Recently viewed section is missing in datahub home page fix(metadata-io):Recently viewed and Recently Edited section is missing in datahub home page Apr 9, 2024
@siladitya2 siladitya2 changed the title fix(metadata-io):Recently viewed and Recently Edited section is missing in datahub home page fix(metadata-io):Recently viewed, Recently Edited and Recently Searched section is missing in datahub home page Apr 10, 2024
Copy link
Collaborator

@david-leifker david-leifker left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks!

@david-leifker david-leifker merged commit 661f173 into datahub-project:master Apr 10, 2024
41 checks passed
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants