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

Load all subcategories when creating a default view. #6882

Merged
merged 16 commits into from
Jul 1, 2024

Conversation

hl662
Copy link
Contributor

@hl662 hl662 commented Jun 20, 2024

  • Adds new method to fetch all subcategories from used spatial categories.
  • Explicitly call that method to populate the subcategories cache on default 3d view creation.

@hl662 hl662 self-assigned this Jun 20, 2024
@hl662 hl662 marked this pull request as ready for review June 21, 2024 17:48
@pmconne
Copy link
Member

pmconne commented Jun 21, 2024

As previously discussed, paging was introduced because we observed truncated responses when too many subcategories existed.
Can you show how that problem has been addressed?

@hl662 hl662 requested a review from nick4598 June 25, 2024 16:03
@hl662
Copy link
Contributor Author

hl662 commented Jun 25, 2024

As previously discussed, paging was introduced because we observed truncated responses when too many subcategories existed. Can you show how that problem has been addressed?

Hey @pmconne, is there a way to reproduce a case in QA, where a response is truncated? It doesn't have to be the query subcategories method. If we're concerned about the response being truncated where either some of the subcategories missing, or the response body itself being incomplete, createDefaultView can fallback to using the original implementation, where querySubCategories is paged.

@hl662
Copy link
Contributor Author

hl662 commented Jun 25, 2024

I also wanted to ask this because I couldn't find an iModel with enough subcategories returned that would elicit a truncated response

@pmconne
Copy link
Member

pmconne commented Jun 25, 2024

I couldn't find an iModel with enough subcategories returned that would elicit a truncated response

I no longer have access to an iModel that produced the problem. Try going back in git history to find when paging was added and see if the PR provides any useful information.

@hl662
Copy link
Contributor Author

hl662 commented Jun 27, 2024

I went back to the earliest PR on discrete viewport sync events, and that's the earliest in the git tree, but I couldn't find any useful information...

To address concerns regarding truncated responses, I've added a try/catch block within the non paging logic of querying the subcategories. If the response is bad, or the subcategories retrieved are incomplete, the original behavior will be fell back upon, which includes the standard paging logic. This ensures we will fill up any missing subcategories, or the case where the json returned is syntactically broken.

@pmconne
Copy link
Member

pmconne commented Jun 27, 2024

If the response is bad, or the subcategories retrieved are incomplete, the original behavior will be fell back upon

Got a test to prove it works?

@hl662
Copy link
Contributor Author

hl662 commented Jun 28, 2024

Got a test to prove it works?

I've added a test for the behavior we're looking for.

Copy link
Member

@pmconne pmconne left a comment

Choose a reason for hiding this comment

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

Add a new RPC interface function queryAllUsedSpatialSubCategories. Do not alter the existing APIs.

@hl662 hl662 requested a review from pmconne July 1, 2024 19:33
Co-authored-by: Paul Connelly <22944042+pmconne@users.noreply.github.com>
@hl662 hl662 merged commit 8fba91d into master Jul 1, 2024
16 checks passed
@hl662 hl662 deleted the nam/default-subcategories branch July 1, 2024 20:40
hl662 added a commit that referenced this pull request Jul 2, 2024
Co-authored-by: Paul Connelly <22944042+pmconne@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants