Skip to content

Count a testing session as use only when touched in the last day - #5840

Merged
shiny-code-app[bot] merged 1 commit into
mainfrom
work/lp5206-recent-session-use
Nov 9, 2026
Merged

shiny-code-app[bot] merged 1 commit into
mainfrom
work/lp5206-recent-session-use

Conversation

@shiny-code-app

@shiny-code-app shiny-code-app Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

The CM testing restore for #5206 is still refused as testing_in_use after #5833 and #5837. A fresh preflight at 3:46 PM ET (trace launchplane_req_d293e2eac9044a909c82948ec86b357e, plan 61cbcb73…) counts one user, odoo-user:8. Its session was last active 2026-11-08 00:05 UTC, about 45 hours earlier, with no sign-in since. #5833 counts a session as use for as long as Odoo keeps it alive, about seven days. The recorded direction for this lane is narrower: session rows without recent sign-ins are stale state, not a person.

What changed: an authenticated session counts as use only when Odoo touched its file in the same window the check already uses for sign-ins. That window is the last 24 hours, and never before the generation boundary. The deletion_time check, a recent sign-in counting as use on its own, the generation boundary, the second scan after SQL, and every unknown-means-protected rule are unchanged.

Removed: the in-container reader for Odoo's session lifetime (SESSION_LIFETIME source parsing and sessions.max_inactivity_seconds), its session_lifetime_unavailable reason code, and four tests for it.

Net lines: -109 (+21/-130).

Refs #5206

Validation

  • 1,156 tests in test_odoo_testing_usage, test_disposable_lane_collection, test_testing_rebuild_http and test_postgres_integration pass. Postgres integration was skipped locally and runs in CI. Ruff, format and mypy are clean.
  • The boundary tests: a session touched 20 hours ago is use, one untouched for 26 hours is not, and a recent sign-in stays use when every session is stale.
  • Independent review: OpenAI via Codex (model not reported by the CLI). No actionable findings. It confirmed that on Odoo 18 and later, normal authenticated requests rewrite the session about hourly, so an active tester stays visible. Odoo 17 can leave an active session untouched longer. Its pickle sessions are already reported as unreadable, so usage stays UNKNOWN there, not unused.
  • IDE inspection: not run. The isolated PyCharm worker is missing its Pydantic plugin (UNKNOWN on Let a migrated restore use the main build its pair was made for #5837 earlier today).

Client test notes

Nothing for the Client to test. The restore itself stays with its operator.

Odoo touches a session file while it is in use. The use check now treats
an authenticated session as a person only when its file changed in the
same 24-hour window it already uses for sign-ins, instead of anywhere
inside Odoo's session lifetime. A session idle for days is stale state.
This removes the in-container lifetime reader and its reason code.
@shiny-code-app

shiny-code-app Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

Review result: weighed
Head: 765da75

Independent review: OpenAI via Codex, read-only. The CLI did not report the model. Result: no actionable findings.

  • Odoo 18 and later rewrite a session about hourly during normal authenticated requests, so an active tester stays inside the 24-hour window. Odoo 17 pickle sessions already read as unreadable, which leaves usage UNKNOWN.
  • The second scan uses the window fixed before SQL. Rebinding since in the login loop does not affect it.
  • No remaining references to the removed lifetime reader or reason code.
  • Noted, not acted on: no test for exact cutoff equality or a session appearing between scans. Neither changes the protection.

@shiny-code-app

shiny-code-app Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

Ready for the merge train

Head: 765da75

@shiny-code-app

shiny-code-app Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor Author

Launchplane completed the merge-train step for this pull request.

Launchplane finished the merge-train step for this pull request.

Launchplane manages this comment and will update it as the train moves.

shiny-code-app Bot added a commit that referenced this pull request Nov 9, 2026
@shiny-code-app
shiny-code-app Bot merged commit 75e2b74 into main Nov 9, 2026
49 checks passed
@shiny-code-app
shiny-code-app Bot deleted the work/lp5206-recent-session-use branch November 9, 2026 21:07
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.

0 participants