fix: presence trouble no longer fails the record features summary; record search no longer refused without read of the tag tables (release/1.2 port of #71) #72

Merged
james.maes merged 2 commits from fix/features-summary-presence-unavailable-1.2 into release/1.2 2026-11-17 20:54:12 +00:00
Owner

Port of #71 to the 1.2 release line: the same two commits, cherry-picked unchanged (the branches differ only in the version in pom.xml).

  1. Presence trouble no longer fails the record features summary. GET /table/{tableName}/{primaryKey}/features answered 503 as a whole while shared presence was recovering (one lease lifetime after the first touch of each table's room in a store that lost its state) or unreachable. The summary now answers with every other part intact, leaves presence unset and reports extensions.presence.status = "unavailable". The presence endpoints keep answering 503. The Who's here card says presence is temporarily unavailable instead of failing, and one visit starts every room's recovery interval. The recovery guard is unchanged: RedisPresenceRecoveryTest.normalUseNeverRestartsRecovery shows normal use cannot restart the interval.
  2. Record search is no longer refused for a person who may not query the tag or custom field value tables. Where a host requires a permission of its own on those tables, the search-term expansion of the Tags field (and of searchable custom fields kept in the value table) made core refuse every search of the table with 403. The expansion now contributes nothing for such a person: the table's other search fields still match and #tag matches nothing. Nobody gains access; an explicit Tags or custom field criterion stays refused.

Details, what was checked and the tests are on #71.

Full ./mvnw -B verify on this head: BUILD SUCCESS, 351 tests, 0 failures, 0 errors, 26 skipped (the MySQL and PostgreSQL upload journal suites, as on the release branch), 0 Checkstyle violations, guardrails and coverage gates passed.

🤖 Generated with Claude Code

Port of #71 to the 1.2 release line: the same two commits, cherry-picked unchanged (the branches differ only in the version in `pom.xml`). 1. **Presence trouble no longer fails the record features summary.** `GET /table/{tableName}/{primaryKey}/features` answered 503 as a whole while shared presence was recovering (one lease lifetime after the first touch of each table's room in a store that lost its state) or unreachable. The summary now answers with every other part intact, leaves `presence` unset and reports `extensions.presence.status = "unavailable"`. The presence endpoints keep answering 503. The Who's here card says presence is temporarily unavailable instead of failing, and one visit starts every room's recovery interval. The recovery guard is unchanged: `RedisPresenceRecoveryTest.normalUseNeverRestartsRecovery` shows normal use cannot restart the interval. 2. **Record search is no longer refused for a person who may not query the tag or custom field value tables.** Where a host requires a permission of its own on those tables, the search-term expansion of the Tags field (and of searchable custom fields kept in the value table) made core refuse every search of the table with 403. The expansion now contributes nothing for such a person: the table's other search fields still match and `#tag` matches nothing. Nobody gains access; an explicit Tags or custom field criterion stays refused. Details, what was checked and the tests are on #71. Full `./mvnw -B verify` on this head: BUILD SUCCESS, 351 tests, 0 failures, 0 errors, 26 skipped (the MySQL and PostgreSQL upload journal suites, as on the release branch), 0 Checkstyle violations, guardrails and coverage gates passed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
james.maes added 2 commits 2026-11-17 20:08:00 +00:00
CollaborationSummaryProvider let the shared presence backend's
service-unavailable answer escape, so core's record features summary
(GET /table/{tableName}/{primaryKey}/features) answered 503 as a whole:
counts, favorite, follow, owner and assignee went with it. With the Redis
backend that happened for one lease lifetime after the first touch of each
table's room in a store that had lost its state (the room is "recovering"),
and for as long as the store was unreachable.

The summary now catches only that case, builds every other part as usual,
leaves presence unset and reports extensions.presence.status =
"unavailable". The wire omits empty collections, so an empty and an unset
presence list look the same; the extension is what tells them apart. The
presence endpoints (/presence, /presence/leases, /presence/leases/renew)
are unchanged and keep answering 503.

The Who's here card had the same shape: it now says presence is
temporarily unavailable instead of failing. It also stopped at the first
recovering room, so it needed one visit per table, a lease lifetime apart,
before it could show counts; a recovering room no longer stops the reading
(any other failure still stops it at once), so one visit starts every
room's interval.

The recovery guard is unchanged. RedisPresenceRecoveryTest
.normalUseNeverRestartsRecovery shows that normal use cannot restart the
interval: every write that advances the guard's latest issued expiry also
leaves a table member (a departure marker included) expiring at exactly
that instant, so the room is never empty before it. Open and leave within
the lease lifetime, an abandoned reservation and idle expiry all end in a
known-empty room under the same generation; only real loss of the
projections starts a new one.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
fix(search): no tag or custom field matches, instead of a refused search, without read of their tables
maven / build (push) Successful in 7m15s
build / maven (push) Successful in 7m15s
404ba3831b
The Tags field is a search field of every taggable table, and so is each
searchable custom field kept in the value table. Core asks each of them to
expand the search term; the expansion is a sub-query on
collaboration_record_tag and collaboration_tag (or
collaboration_field_value). With the default rules every reader may query
those tables, but a host can require a permission of its own on them. Core
checks table READ for each sub-query table and one refusal refuses the
whole query, so every record search of such a table answered 403 for a
person without that permission, whatever the text.

TagCriteriaExpander.expandSearchTerm and
FieldCriteriaExpander.expandSearchTerm now ask core the same question
first (PermissionsHelper.hasTablePermission with an enforced QueryInput
for the table, the check core applies to a sub-query) and return null when
the session may not query the tables. Core's contract for null is "this
field does not match the term": the other search fields of the table still
match, and a #tag search matches nothing.

Nobody gains access. An explicit Tags or custom field criterion on a
record list is unchanged: it is still refused by core for such a person. A
silent empty result would be wrong for the negative operators (is not,
is blank) and misleading for the positive ones, and the refusal already
names the missing permission. A person who may query the tables searches
and filters as before.

SearchWithoutCollaborationReadTest (memory backend, materialized
sub-queries) and CustomFieldValuesPostgresTest
.searchSurvivesHostProtectedCollaborationTables (PostgreSQL, native
sub-queries) put a host permission in front of each table's own checker:
without it a text search returns the table's own matches, tag and custom
field terms return nothing, nothing throws and the explicit criterion is
refused; with it the results are the same as with the default rules. Both
fail before this change with QPermissionDeniedException on the first
search.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
james.maes merged commit 1ee3027af5 into release/1.2 2026-11-17 20:54:12 +00:00
Sign in to join this conversation.