Skip to content

[BUG] Verification screen continuously requests a non-existent page when a completed document is reopened #327

Description

@mshkkkkk

Description
When a completed document is reopened, the verification screen uses a cursor value beyond the document’s total page count and continuously requests a non-existent page.
For a 7-page document, the frontend repeatedly sends:
GET /documents/{id}/pages?from=8&limit=5
The backend returns 200 OK with an empty items array, but the frontend immediately repeats the same request.
The expected navigation behavior was discussed with the Product Owner. When a completed document is opened, the verification screen should open the first page with a non-success status. If there are no such pages, it should open the last document page.

Preconditions

  • The document has the done status.
  • The document contains at least one page with a non-success status.

Steps to Reproduce

  1. Open the Documents page.
  2. Open the completed document.
  3. Open DevTools → Network.
  4. Observe the page displayed on the verification screen.
  5. Observe requests to /documents/{id}/pages.

Expected Behavior

  • The verification screen opens the first page with a non-success status.
  • If the document has no pages with a non-success status, its last page is opened.
  • The frontend does not request a page number greater than the document’s total page count.
  • Requests are not repeated indefinitely when the API returns an empty items array.

Actual Behavior

  • The screen displays “Preparing the next page”.
  • The frontend continuously sends GET /documents/{id}/pages?from=8&limit=5.
  • Every request returns 200 OK with {"items":[]}.
  • The page requiring attention is not opened.
  • The requests continue indefinitely.

Environment

Additional Information
The expected behavior was discussed with the Product Owner:

  • Open the first page with a non-success status.
  • If no such page exists, open the last document page.
chrome_NZkiPlwRfM.mp4

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or requestfrontendFrontend application

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions