What we found
Before any optional Frappe app is offered on our sites, we review it and rehearse its install and removal on a copy of our image. On October 20 that review was for Frappe Wiki 3.4.0.
Wiki 3.x gives every new user its Wiki User role, through a doc_events hook on User after_insert. Frappe creates that role from Wiki’s permissions, with Desk access on.
In Frappe, a user’s type follows their roles. So after a Wiki install, a portal user created later becomes a System User, with Desk, the next time their record is saved. That’s a customer or supplier who should only ever see the portal. Nothing about it is visible at install time: the change happens later, one user at a time, as records are saved.
No site had Wiki at the time. The finding came from the admission review, and the first version of the fix was a line in the catalog’s setup notes: “untick Desk Access on Wiki User first”. A step that depends on a person remembering it isn’t a fix, so we made it part of the install.
Where the step belongs
Our sidecar, the small agent on each customer server, runs app installs: snapshot, maintenance mode, install, migrate, checks, and a rollback if anything fails. We considered three places for the setting:
- The control plane, after the install. It can’t write to a site directly. A second job after the install would leave a gap, with maintenance off, in which a new portal user could still get Desk.
- The image manifest, as an app setting next to the version pin. That changes a contract and needs an image rebuild, which is more than one role needs. If more apps need settings later, that’s where they’ll go.
- The sidecar’s install job, after migrate and before the checks. We chose this one. It runs inside the same maintenance window, snapshot and rollback, so no user can be created between the install and the setting. If the setting can’t be made, the whole install rolls back.
What the install does now
Sidecar 0.13.2 keeps a small table of roles an app gives to every new user that must not carry Desk access. Today it has one entry:
_NO_DESK_ROLES = {"wiki": ("Wiki User",)}After migrate, the install turns Desk access off on each listed role and saves the Role document, which is exactly what unticking the box in Desk does. Frappe then re-evaluates the user type of everyone holding the role. A role that’s already off is left alone.
It fails closed. If the role doesn’t exist, or still has Desk access after the save, the install rolls back with the step named settings. A future Wiki release that renamed the role would otherwise hand the new name Desk access without anyone noticing.
The control plane also gained a per-app minimum sidecar version. Staff can’t install Wiki on a server whose sidecar predates the fix: they get a plain message that the site’s agent needs an update first.
How we checked it
The rehearsal gained a generic check. It creates a portal user with only the Customer role, saves it once more, and expects a Website User. The check runs with every carried app installed, and again after a migrate.
- Sidecar 0.13.2: 127 checks passed, 0 failed.
- The released 0.13.0: 125 passed, 2 failed. The two failures were exactly the new checks: the user was saved as a System User with both the Customer and Wiki User roles.
On the kept stack, that portal user could read the published Wiki page, got a 403 on Desk, and was still a Website User after another save. Sidecar 0.13.2 went live on our own site that night; the update took about 20 seconds.
What we’d tell someone else
When you admit a third-party app, look at what it does to users who don’t exist yet. Install-time checks pass, because the effect lands later, on records created after the install.
And make the fix part of the install, inside its rollback, rather than a step in a setup guide.