Skip to content

Base form expiration on server time - #3599

Closed
OllieinCanada wants to merge 1 commit into
nextcloud:mainfrom
OllieinCanada:fix/server-time-expiration
Closed

Base form expiration on server time#3599
OllieinCanada wants to merge 1 commit into
nextcloud:mainfrom
OllieinCanada:fix/server-time-expiration

Conversation

@OllieinCanada

Copy link
Copy Markdown

Summary

  • expose the server Unix timestamp through Nextcloud initial state on internal and public form pages
  • derive current server time with performance.now(), keeping expiration checks independent of the client's wall clock even if it changes after page load
  • use the server-relative time in every frontend form-expiration decision point
  • add a controller unit test that verifies the server timestamp is provided

Rationale

The backend already decides expiration with server time, but the frontend compared form.expires with moment().unix(). A client clock set in the future could therefore hide a form that the server still considers active. Anchoring a monotonic timer to the server timestamp keeps the UI consistent with backend authorization without repeated network requests.

Validation

  • Prettier check on all touched frontend files
  • ESLint on all touched frontend files
  • git diff --check
  • PHP unit and clean production-build coverage delegated to CI because PHP is unavailable locally and the Windows npm install had incomplete package extraction

Fixes #3598

@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
lib/Controller/PageController.php 50.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

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.

Expiration Date misbehaves when the client is misconfigured

1 participant