Skip to content

[bugfix] projects: reopen a reloaded tab's own lease and name the other-window conflict (#277) - #279

Open
Zhangbo-cn wants to merge 1 commit into
ThinkFlowLab:mainfrom
Zhangbo-cn:fix/277-session-lease
Open

Zhangbo-cn wants to merge 1 commit into
ThinkFlowLab:mainfrom
Zhangbo-cn:fix/277-session-lease

Conversation

@Zhangbo-cn

Copy link
Copy Markdown

Summary

  • Reloading after a lost lease release no longer waits out the lease.
    • Each page still gets a new session ID. The previous page's ID is now kept in sessionStorage.
    • Before its first request, a reloaded tab releases that previous session, but only when no live page still holds the session's Web Lock.
    • A crashed or killed tab can no longer block its own reload for the 60 s lease.
    • A duplicated tab copies sessionStorage, but it finds the original window's lock still held, so it never releases a live window.
    • Browsers without Web Locks keep the current behavior.
  • "Open in another window" has its own error code, project_open_elsewhere.
    • Its zh-CN/en-US text is accurate. English previously said "Project storage is busy".
    • storage_busy again means only a storage lock timeout, which keeps its retries and Retry-After.
    • A fresh window that another live window blocks is refused at once. Only a reloaded tab waits briefly on its own lease.

Linked issue

Labels

  • Suggested: type:bug, area:canvas, area:i18n. I can't apply labels from a fork.

Test plan

  • Local:
    • pytest: 1581 passed, 98 skipped.
    • npm test: 760 passed, including the new tests/sessionLease.test.ts.
    • tsc --noEmit, npm run build, npm run check:i18n and npm run check:browser-manifest are clean.
    • New gate script tests/browser/session_lease.mjs:
      • Covers zh-CN and en-US.
      • A reload with a dropped release reopens in about 2 s with no 409.
      • A second window is refused with project_open_elsewhere.
      • On main, the same reload times out.
    • scripts/run-browser-suite.mjs passed 20/20 on fresh fixture services.
  • Left to CI: Release checks.

Evidence that it works

  • N/A for media. This is a behavior and error-code change with no new UI. The browser script above is the evidence:
    PASS en-US: reload reopened in 1932 ms; second window refused: This project is open in another window. Close it there and try again.
    PASS zh-CN: reload reopened in 1918 ms; second window refused: 该项目正在其他窗口中打开,请先关闭后再试。
    

Provider verification

  • No provider calls are involved.

Bilingual UI

  • zh-CN and en-US backend messages were updated together.

…er-window conflict (ThinkFlowLab#277)

## summary

- Keep the previous page's session ID in `sessionStorage`. Before its first
  request, a reloaded tab releases that session when no live page still holds
  its Web Lock, so a crashed or killed page no longer blocks the reload for
  the 60 s lease. A duplicated tab copies `sessionStorage` but finds the
  original's lock held, so it never releases a live window.
- Give "project open in another window" its own `project_open_elsewhere` code
  with bilingual text. `storage_busy` again means only a storage lock timeout;
  it keeps its retries and `Retry-After`. Only a reloaded tab waits briefly
  on its own lease; a fresh window is refused at once.

## validation

- `pytest`: 1581 passed, 98 skipped; `npm test`: 760 passed; `tsc`, `build`,
  `check:i18n`, `check:browser-manifest`: clean.
- New gate script `tests/browser/session_lease.mjs` (zh-CN, en-US): reload
  with a dropped release reopens in about 2 s with no 409, and a second window
  is refused with `project_open_elsewhere`. On `main` the reload times out.
- `scripts/run-browser-suite.mjs`: 20/20 passed on fresh fixture services.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] 工程:租约未释放时刷新被当作其他窗口拒绝,英文提示误报存储繁忙

1 participant