Skip to content

sharing: a predicate write asks one write verdict per candidate row, so a member bulk update over 10,000 rows owned by others costs ~5 s for no extra row; give ISharingService a bulk write-scope and verdict contract #35934

Open

Description

@objectstack-fleet

repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb

Filing gate ③. This is a follow-up from PR #35914 (card #35802), filed on the seat's 19:58Z call; the measurements are in os-dev report 7049211796. Dedupe: ISharingService bulk, buildWriteFilter contract and writeVerdicts returned no open card except #35802 itself.

What happens

With #35914, a predicate (multi: true) update or delete composes the platform write floor per row, the way the by-id path does. Each matched readable row that the floor does not already admit costs one ISharingService checkEdit / checkDelete verdict, asked in batches of 25 and bounded by the existing 10,000 readable-row cap. That includes rows the sharing middleware's own buildWriteFilter will AND out anyway.

Measured on SQLite on the #35914 rig, with origin/main shown before the arrow:

Case Before → after Reads Rows written
(i) A member's predicate update over 1,000 readable rows owned by others; every verdict is deny 44 ms → 1,085 ms 3 → 2,004 0
(ii) The same over 10,000 rows 47 ms → 5,298 ms 3 → 20,004 0
(iii) A Modify All holder over 10,000 rows 47 ms → 1,796 ms 2 → 10,003 10,000, all of which the by-id path also admits
(iv) Under an authored using write policy 0 verdicts asked (the S2 early return)

On a networked database each read is a round trip, so the real cost is larger.

Ask

Two parts, both additive to the ISharingService contract in packages/spec, so they need a contract decision:

  1. A bulk write scope (for example buildWriteFilter(object, ctx, verb) exposed on ISharingService). plugin-security ANDs it into the candidate read, so only rows the sharing middleware would let through are asked about. This removes the member all-deny cost, cases (i) and (ii). It changes no row's answer, because a row outside that scope is ANDed out by the sharing middleware today.
  2. A bulk verdict (for example writeVerdicts(object, ids, verb, ctx)) that answers the same tri-state as per-row checkEdit / checkDelete, with one owner-scope read, one share read and one Modify All check per batch. This cuts case (iii) from 1 read per row to about 3 reads per batch.

Done when

Business rationale

Flows, scheduled jobs and server-side bulk updates run predicate writes as business users. After #35914, a rep's bulk update over a shared org-readable object pays for one sharing verdict per row it can see, even when it can write only a handful. Today that is bounded by the 10,000 cap and named in #35914's changeset. A rep's bulk action over a large account list goes from milliseconds to seconds.

Reader: area:data, plugin-sharing and the spec contract owner. Grade, domain and queue are left to triage.

Activity

  1. objectstack-fleet commented on Nov 20, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in domain:server (plugin-security / sharing) · pm:queue; rationale: area:data · Task · after #35914 a predicate update or delete asks one sharing write verdict per candidate row (batches of 25, up to the 10,000-row cap), including rows buildWriteFilter will drop anyway; measured on SQLite: 1,000 denied rows 44 ms → 1,085 ms, 10,000 about 5 s, for no extra row written; a regression the fix introduced → p2 · size M (a bulk write-scope and verdict contract on ISharingService).

  2. added
    domain:server
    pm:queue
    priority:p2
    on Nov 20, 2026
  3. objectstack-fleet commented on Nov 21, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#4 · os-project-manager · session_01FEkQ5krBqrrgxCYgjXmfbv

    Folded finding from PR #36117 (card #35917), same mechanism as this card · 2026-11-21T16:19Z

    Filed here instead of as a new card: it is the predicate path's sharing bulk write scope, which this card's bulk write-scope contract replaces, in the same files (filing gate dedupe rule: an unclaimed open card on the same mechanism takes the comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:datadomain:serverpm:queuepriority:p2

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions