hypertrace / hypertrace-ui

UI for Hypertrace
Other
25 stars 12 forks source link

fix: topology query caching #2402

Closed itssharmasandeep closed 1 year ago

itssharmasandeep commented 1 year ago

πŸ˜΅β€πŸ’« ISSUE

Whenever we apply an edge filter for a particular entity, we need to omit the edges for all the other entities and only query for the particular entity edge. Once we do that and remove the filter, the query fired still doesn't contain the omitted edges and only contains the edge filter once, which leads to the wrong results

FIX πŸ”¨

This is happening because of the id field in the entities query. This field is used by Apollo to cache the query structure. Once we change this and use an alias entityId this starts working fine. We did a similar thing earlier for another issue with entities query. https://github.com/hypertrace/hypertrace-ui/pull/2334

NOTE: EntityTopologyGraphQlQueryHandlerService has its own implementation of entities query

codecov[bot] commented 1 year ago

Codecov Report

Merging #2402 (0aa4990) into main (447363c) will decrease coverage by 38.59%. The diff coverage is 0.00%.

@@             Coverage Diff             @@
##             main    #2402       +/-   ##
===========================================
- Coverage   82.99%   44.41%   -38.59%     
===========================================
  Files         921      921               
  Lines       20566    20566               
  Branches     3245     3245               
===========================================
- Hits        17069     9134     -7935     
- Misses       3375    10904     +7529     
- Partials      122      528      +406     
Files Coverage Ξ”
...y/entity-topology-graphql-query-handler.service.ts 15.21% <0.00%> (-80.44%) :arrow_down:

... and 324 files with indirect coverage changes

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

github-actions[bot] commented 1 year ago

Unit Test Results

βŸβ€„β€ˆβŸβ€„βŸβ€„4 files  Β±0β€‚β€ƒβŸβ€„β€ˆ310 suites  Β±0   48m 47s :stopwatch: + 7m 55s 1β€ˆ124 tests Β±0  1β€ˆ124 :heavy_check_mark: Β±0  0 :zzz: Β±0  0 :x: Β±0  1β€ˆ134 runs  Β±0  1β€ˆ134 :heavy_check_mark: Β±0  0 :zzz: Β±0  0 :x: Β±0 

Results for commit d5ce3300. ± Comparison against base commit 46309efa.

github-actions[bot] commented 1 year ago

Unit Test Results

βŸβ€„β€ˆβŸβ€„βŸβ€„4 files  Β±0β€‚β€ƒβŸβ€„β€ˆ310 suites  Β±0   42m 57s :stopwatch: - 6m 29s 1β€ˆ126 tests Β±0  1β€ˆ126 :heavy_check_mark: Β±0  0 :zzz: Β±0  0 :x: Β±0  1β€ˆ136 runs  Β±0  1β€ˆ136 :heavy_check_mark: Β±0  0 :zzz: Β±0  0 :x: Β±0 

Results for commit 5b5f23b4. ± Comparison against base commit df15d513.

github-actions[bot] commented 1 year ago

Unit Test Results

βŸβ€„β€ˆβŸβ€„βŸβ€„4 files  Β±0β€‚β€ƒβŸβ€„β€ˆ311 suites  Β±0   52m 12s :stopwatch: + 3m 5s 1β€ˆ127 tests Β±0  1β€ˆ127 :heavy_check_mark: Β±0  0 :zzz: Β±0  0 :x: Β±0  1β€ˆ137 runs  Β±0  1β€ˆ137 :heavy_check_mark: Β±0  0 :zzz: Β±0  0 :x: Β±0 

Results for commit 0aa4990d. ± Comparison against base commit 447363cc.

github-actions[bot] commented 1 year ago

Unit Test Results

βŸβ€„β€ˆβŸβ€„βŸβ€„4 files  Β±0β€‚β€ƒβŸβ€„β€ˆ311 suites  Β±0   48m 26s :stopwatch: -41s 1β€ˆ127 tests Β±0  1β€ˆ127 :heavy_check_mark: Β±0  0 :zzz: Β±0  0 :x: Β±0  1β€ˆ137 runs  Β±0  1β€ˆ137 :heavy_check_mark: Β±0  0 :zzz: Β±0  0 :x: Β±0 

Results for commit 1f87f1c3. ± Comparison against base commit 447363cc.