Skip to content

Ensure that we display an appropriate error message for when there is .maintenance file#3948

Open
katinthehatsite wants to merge 4 commits into
trunkfrom
fix/stuck-lock-file
Open

Ensure that we display an appropriate error message for when there is .maintenance file#3948
katinthehatsite wants to merge 4 commits into
trunkfrom
fix/stuck-lock-file

Conversation

@katinthehatsite

@katinthehatsite katinthehatsite commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Related issues

Fixes STU-1847

How AI was used in this PR

It was used to implement the solution.

Proposed Changes

This PR ensures that when there is a .maintenance file and a fresh lock, the appropriate message is displayed to the user if they try to stop and start the site. It detects the lock that is fresher than 10 minutes and after 10 minutes, WordPress will ignore the stale lock file.

Testing Instructions

  • Pull the changes from this branch and start Studio with npm start
  • Create a site (or use an existing one) and start it
  • Test fresh lock — create a .maintenance file with a recent timestamp by running in your Terminal the following (make sure to replace with the name of your site):
  echo '<?php $upgrading = '$(date +%s)'; ?>' > ~/Studio/<your-site-name>/.maintenance
  • Stop the site in Studio, then try to start it. You should see a message saying WordPress is in maintenance
    mode and the lock will expire within 10 minutes:
Screenshot 2026-06-25 at 12 03 28 PM
  • Test no lock — delete the file:
    rm ~/Studio/<your-site-name>/.maintenance
  • Start should work normally.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@katinthehatsite katinthehatsite self-assigned this Jun 24, 2026
@katinthehatsite katinthehatsite marked this pull request as draft June 24, 2026 14:34
@wpmobilebot

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 63ad173 vs trunk

app-size

Metric trunk 63ad173 Diff Change
App Size (Mac) 1311.88 MB 1311.89 MB +0.01 MB ⚪ 0.0%

site-editor

Metric trunk 63ad173 Diff Change
load 1065 ms 1036 ms 29 ms ⚪ 0.0%

site-startup

Metric trunk 63ad173 Diff Change
siteCreation 6501 ms 6477 ms 24 ms ⚪ 0.0%
siteStartup 6980 ms 6981 ms +1 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

@katinthehatsite katinthehatsite changed the title Ensure lock files get detected after 10 minutes Ensure that we display an appropriate error message for when there is .maintenance file Jun 25, 2026
@katinthehatsite

Copy link
Copy Markdown
Contributor Author

This is the behaviour compared to trunk:

Screenshot 2026-06-25 at 2 16 25 PM

@katinthehatsite katinthehatsite marked this pull request as ready for review June 25, 2026 12:16
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.

2 participants