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

ScreenViewport.waitForSceneCompletion does not resolve under certain conditions #7618

Open
thanhbinh-d opened this issue Jan 27, 2025 · 6 comments
Assignees
Labels
bug Something isn't working display needs triage

Comments

@thanhbinh-d
Copy link

thanhbinh-d commented Jan 27, 2025

Describe the bug
When a sheet contains a Drawing attachment with an incorrect X offset, the function waitForSceneCompletion does not resolve. This causes the application to hang indefinitely, preventing further actions.

Steps to Reproduce:

  1. Open the iModel and switch to the Civil Frontstage. (Note: Contact Raphael Lemieux for permission to access the test model.)
  2. In the Civil Frontstage, open the sheet "A001 cord22 - 606+50xxx" in the Sheet Viewer Widget.
  3. Click the Print Preview button.
  4. Observe that the function hangs because it uses the waitForSceneCompletion API before capturing the sheet image.

Expected behavior
The function waitForSceneCompletion should resolve even when there are incorrect Drawing attachments, ensuring that the viewport scene completes rendering regardless of attachment issues.

Suggestion for Improvement:
To make the API more robust and user-friendly, consider adding an optional timeout parameter to the waitForSceneCompletion function. This would allow developers to specify a maximum wait time, preventing indefinite hangs in edge cases like this.
For example:
await viewport.waitForSceneCompletion({ timeout: 100 }); // Timeout in milliseconds

Screenshots

Image

@pmconne
Copy link
Member

pmconne commented Jan 27, 2025

Hi @thanhbinh-d, can you please provide steps to reproduce?

@thanhbinh-d
Copy link
Author

Hi @thanhbinh-d, can you please provide steps to reproduce?

The bug description was updated.
Thanks,
Binh

@pmconne
Copy link
Member

pmconne commented Jan 27, 2025

Contact Raphael Lemieux for permission to access the test model

@raplemie are you able to provide iTwin+iModel Id and grant read access to me and @markschlosseratbentley?

@pmconne pmconne added bug Something isn't working display needs triage labels Jan 27, 2025
@markschlosseratbentley markschlosseratbentley unpinned this issue Jan 27, 2025
@raplemie
Copy link
Contributor

@markschlosseratbentley @pmconne added, this iModel is in QA:
iTwin 71f06c2a-d1a1-466f-8566-40bc85863c11
iModel 62e69c4c-86af-4d54-a22f-fee6c7c7b9c8
Changeset ce8e877b6c5ec33b4707e762abe189a4abadd625

(Mentioning changeset as later changeset modify the location of the additional graphics and do not exhibit the same issue)

@markschlosseratbentley
Copy link
Contributor

markschlosseratbentley commented Jan 28, 2025

Hi @raplemie and @thanhbinh-d I am trying to reproduce this locally where it is easier to debug.

I can make this problem happen in the Civil frontstage of your linked web app.

However, I am having trouble doing it locally. Is this particular sheet view "A001 cord22 - 606+50xxx" available in a standalone .bim file of this iModel (which I downloaded)?

Locally, I see "cord22 - 606+50.00 [Sheet] Views - View 1", but it does not reproduce the issue. It visually looks similar.

I am using the dta save image keyin tool, in itwinjs-core/test-apps/display-test-app, which uses waitForSceneCompletion as well.

@thanhbinh-d
Copy link
Author

thanhbinh-d commented Jan 28, 2025

Hi @markschlosseratbentley
The sheet view definition “cord22 - 606+50.00 [Sheet] Views - View 1” is not related to the sheet “A001 cord22 - 606+50.00 [Sheet]” with ID 0x60000000262.

The sheet “A001 cord22 - 606+50.00 [Sheet]” is associated with three drawing view definitions, not a sheet view definition. I will send you some related images in person soon.

Regarding the other question, perhaps @raplemie can provide more insights.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working display needs triage
Projects
None yet
Development

No branches or pull requests

4 participants