Skip to content

fix: set the Strapi peer floor to 5.50.0, the first version the plugin works on - #23

Merged
Schero94 merged 1 commit into
mainfrom
fix/strapi-peer-floor
Nov 18, 2026
Merged

Schero94 merged 1 commit into
mainfrom
fix/strapi-peer-floor

Conversation

@Schero94

Copy link
Copy Markdown
Owner

Summary

The @strapi/strapi and @strapi/plugin-users-permissions peers said ^5.0.0 (README badge "Strapi 5.0+"), but CI only ever tested the current Strapi. Testing the declared floor shows the plugin needs Strapi 5.50.0. This PR corrects the claim (patch, fix:; older hosts never worked fully, so this is not a breaking change).

Evidence per API

API the plugin relies on First Strapi version Source
strapi.sessionManager, admin::session, U&P jwtManagement (refresh / legacy-support) 5.24.0 release notes v5.24.0 "Advanced Session Configuration" (#24346); absent from @strapi/core, @strapi/admin, U&P 5.23.6 tarballs
Session-manager listSessions, revokeSessionById, findByUser; admin::session.metadata (device label) 5.50.0 release notes v5.50.0 "admin: add active devices session management" (#26628); installed 5.49.0 lacks them, 5.50.0 has them
Homepage widgets API (app.widgets.register) 5.13.0 (guarded with a feature check) release notes v5.13.0 "make widgets api stable"
Design System 2 exports used by the admin bundle (43 DS names, 28 icons, @strapi/strapi/admin Page/Layouts/Form/Blocker/useForm/...) present in DS/icons 2.2.1 shipped with 5.50.0 packed tarball installed into a 5.50.0 app, strapi build passes, names checked against installed exports
@strapi/sdk-plugin 6.1.1 output loads in 5.50.0 packed tarball, admin build + browser smoke
Node engines Strapi 5.0.0-5.0.3 declare node <=20.x; 5.0.4+ include 22; 5.50.0 declares >=20 <=26 npm view @strapi/strapi@X engines vs plugin ^22.22.2 || >=24.15.0

Real-HTTP suites per Strapi version

Isolated hosts in a scratch directory (synthetic users, random secrets, outbound network blocked), Node 22.23.1, SQLite.

Strapi access legacy access refresh fallback logout admin panel sessions native capture
5.0.4 fails at boot of test (no sessionManager) same same same same
5.23.6 same as 5.0.4 same same same same
5.24.0 34/37 16/34 36/38 7/14 4/16
5.30.0 / 5.40.0 / 5.45.0 / 5.49.0 34-35/37 16/34 (sign-in 503) 36/38 7/14 (500) 4/16
5.50.0 37/37 39/39 38/38 14/14 16/16
5.62.0 37/37 39/39 38/38 14/14 16/16

Packed tarball on a 5.50.0 app: strict npm install (no --legacy-peer-deps) without peer errors, one @strapi/utils (5.50.0, deduped), one React / styled-components / react-router-dom; refresh-mode register + login return jwt and refreshToken; strapi build passes; browser smoke (Playwright, 1440 px) of home widget, App users dashboard, Admin panel sessions, Settings > Configuration and Analytics: expected content rendered, 0 px overflow, no page errors, no failed plugin API calls (only console errors: Strapi core's blocked GitHub update check).

Changes

  • peerDependencies: @strapi/strapi and @strapi/plugin-users-permissions ^5.50.0 (lockfile synced).
  • server/src/utils/strapi-version.js + register.js: one clear start-up error on Strapi older than 5.50.0.
  • CI job strapi-floor: installs Strapi 5.50.0 + U&P 5.50.0 in $RUNNER_TEMP and runs all five real-HTTP runs.
  • tests/strapi-version-floor.test.js (new, written failing first) and a portable provider-callback case in tests/isolated-native-capture-http.test.js (5.50 reads the token from the query, 5.62 from the grant session).
  • README badge "Strapi 5.50+", Compatibility table, new "Strapi older than 5.50" upgrade section, CI note; Pages badge and table; CHANGELOG [Unreleased] with upgrade note.

Gate (local, commit 0b975d2)

npm run lint 0 problems, npm run format:check clean, npm test 864/864, test:ts:front and test:ts:back pass, build, verify, verify:runtime pass, CHANGELOG check CHANGELOG_OK.

Release type: patch (fix:).

🤖 Generated with Claude Code

…n works on

The @strapi/strapi and @strapi/plugin-users-permissions peers said ^5.0.0, but
nothing below the current release was ever tested. The plugin calls
listSessions and revokeSessionById on Strapi's session manager and reads the
metadata column of admin::session, all added in Strapi 5.50.0
(strapi/strapi#26628, "add active devices session management").

Measured with the real-HTTP suites on isolated hosts (synthetic data, random
secrets, egress blocked):
- 5.0.4, 5.23.6: no strapi.sessionManager and no admin::session (added 5.24.0);
  5.0.0-5.0.3 also declare node <=20, outside our engines.
- 5.24.0, 5.30.0, 5.40.0, 5.45.0, 5.49.0: refresh-mode sign-in fails closed
  with 503, session routes fail, admin panel sessions return 500.
- 5.50.0, 5.62.0: every suite passes; the packed tarball installs on 5.50.0
  without peer warnings and the admin panel builds and renders.

- Peers ^5.50.0; one clear start-up error on older Strapi.
- CI job strapi-floor runs the HTTP suites against Strapi 5.50.0.
- Native capture provider-callback case sends the token in the query too
  (5.50 reads the query, 5.62 the grant session).
- README badge and Compatibility, Pages, CHANGELOG with upgrade note.

Docs read: Strapi release notes v5.13.0, v5.24.0, v5.50.0 (gh release view,
2026-11-18); docs.strapi.io/cms/upgrade-tool; installed @strapi/core,
@strapi/admin and @strapi/plugin-users-permissions sources 5.24.0-5.62.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Schero94
Schero94 merged commit a9f522f into main Nov 18, 2026
7 checks passed
github-actions Bot pushed a commit that referenced this pull request Nov 18, 2026
## [4.14.1](v4.14.0...v4.14.1) (2026-11-18)

### Bug Fixes

* set the Strapi peer floor to 5.50.0, the first version the plugin works on ([#23](#23)) ([a9f522f](a9f522f))

Release type: patch (`fix`). This corrects an untested compatibility claim; it is not a breaking change, because the plugin never worked fully on the Strapi versions now excluded.

### Fixed

* **Strapi peer floor corrected from `^5.0.0` to `^5.50.0`** (`@strapi/strapi` and `@strapi/plugin-users-permissions`). The old range was never tested. Strapi 5.50.0 added the session-manager methods the plugin calls (`listSessions`, `revokeSessionById`) and the `metadata` column of `admin::session` ([strapi/strapi#26628](strapi/strapi#26628)). Measured with the real-HTTP suites on isolated hosts: on 5.24.0, 5.30.0, 5.40.0, 5.45.0 and 5.49.0, sign-in with `jwtManagement: 'refresh'` fails closed with 503, session list and revoke routes fail, and the Admin panel sessions routes return 500 in both JWT modes; 5.0.4 and 5.23.6 have no session manager or `admin::session` at all; 5.0.0 to 5.0.3 declare Node.js 20 or older, outside this plugin's `engines`. On 5.50.0 and 5.62.0 every suite passes.
* The plugin logs one clear error at start-up on Strapi older than 5.50.0 (`Strapi 5.x.y is not supported: Magic Session Manager requires Strapi 5.50.0 or later …`) instead of failing later on single requests.
* README badge, Compatibility table and project site now say Strapi 5.50+.

### Upgrade note

* Strapi 5.50.0 or later: nothing to do.
* Strapi older than 5.50.0: upgrade Strapi first (`npx @strapi/upgrade minor`), rebuild the admin and restart. npm 7+ refuses to install this release next to an older Strapi because of the peer range; until you upgrade Strapi, stay on your current plugin version.

### Tests

* New CI job `strapi-floor` installs Strapi 5.50.0 and Users & Permissions 5.50.0 into a separate directory and runs the HTTP access suite (legacy, refresh, fallback logout), the admin panel sessions suite and the native session capture suite against it.
* `tests/strapi-version-floor.test.js` checks the floor constant, the start-up error, that the peers and the CI job name the same floor.
* The native capture suite's provider-callback case now also sends the provider token in the query string, which Strapi 5.50 reads (5.62 reads the grant session), so it runs on both versions.
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.

1 participant