Compare commits

..
10 Commits
Author SHA1 Message Date
james.maes 3c865a5c97 Merge pull request 'fix: presence trouble no longer fails the record features summary; record search no longer refused without read of the tag tables' (#71) from fix/features-summary-presence-unavailable into develop
maven / build (push) Successful in 7m15s
build / maven (push) Successful in 7m15s
2026-11-17 20:54:05 +00:00
james.maesandClaude Fable 5.2 c28f839658 fix(search): no tag or custom field matches, instead of a refused search, without read of their tables
maven / build (push) Successful in 7m0s
build / maven (push) Successful in 7m0s
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>
2026-11-17 13:54:32 -06:00
james.maesandClaude Fable 5.2 551c4c6f87 fix(presence): the record features summary no longer fails when presence is unavailable
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>
2026-11-17 13:38:31 -06:00
james.maes fbce2e5d6e Merge pull request 'fix(targets): ask whether a table is readable as a query, not with an untyped input' (#69) from fix/target-read-asked-as-query into develop
maven / build (push) Successful in 6m55s
build / maven (push) Successful in 6m55s
2026-11-12 17:20:43 +00:00
james.maesandClaude Fable 5.2 70f6184a7a fix(targets): ask whether a table is readable as a query, not with an untyped input
maven / build (push) Successful in 8m41s
build / maven (push) Successful in 8m46s
TargetResolver.canReadTable asked PermissionsHelper.hasTablePermission with a
bare AbstractActionInput. Core hands a table's custom permission checker the
action input and not the permission asked, so a checker that tells a read
from a write by the input's type (a query, a get or a count reads; anything
else is refused) refused the question. For such a table every recents and
favorites call answered "Not found" for people the checker lets read it:
the UI sends POST /recents on every list and record screen, so each of them
showed "Resource not found POST /qqq/v1/qbit/collaboration/recents (HTTP
404)".

The read is now asked with a QueryInput for the table, the read it stands
for; ParentRecordAccess already asks with a GetInput. Who may read a table
does not change: the checker still decides, and a person it refuses is
still answered "Not found" (RecentsServiceTest
.tableWithAnInputTypedPermissionCheckerIsATarget, which failed before with
QNotFoundException on the first call).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 10:53:22 -06:00
james.maes 16bd4f768f Merge pull request 'perf: skip tag lookups for tables with no tag assignments (forward-port of #67)' (#68) from fix/read-path-statements-develop into develop
maven / build (push) Successful in 7m34s
build / maven (push) Successful in 7m34s
2026-11-10 22:11:02 +00:00
james.maesandClaude Fable 5.2 04d04adc6e perf(security): authorize each distinct parent once per child result page
maven / build (push) Successful in 7m15s
build / maven (push) Successful in 7m15s
ParentRowCustomizer and AttachmentPreviewCustomizer read the parent of
every child row to decide whether the row is visible, so rows that share a
parent repeated the same read: 61 tasks on two parents ran 61 parent reads
(TagLookupStatementBudgetTest), now 2. The answer is kept only for the one
postQuery call, where the session and transaction cannot change.

Also correct the README: the Tags field is selectable.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-10 15:58:11 -06:00
james.maesandClaude Fable 5.2 de922d7e86 perf(tags): no assignment lookup for tables that have no tags
Core selects the Tags virtual field for every query or get that names no
fields, so every such read of a TAGS-enabled table ran one
collaboration_record_tag statement, including reads made one record at a
time and tables that were never tagged. Measured with 600 added parents
(TagLookupStatementBudgetTest): a 602-row list ran 2 statements, 600 gets
ran 600 and 100 single-record updates ran 100; now 1 probe, then 0.

TaggedTables remembers, per node and per table, whether any assignment
exists (core Memoization registered with ClusterCaches, 30 s by default,
withTagLookupCacheSeconds, 0 disables). Writing an assignment clears it at
once and after commit and publishes memo-invalidate. The probe ignores row
locks and returns no data, so the answer is the same for every session.
Tables with assignments are read as before: one lookup per 500 parents.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-10 15:58:11 -06:00
james.maes c6b077321c Merge pull request 'fix(upload-journal): accept Amazon Aurora PostgreSQL (full_page_writes=off)' (#65) from fix/aurora-full-page-writes-develop into develop
maven / build (push) Successful in 7m35s
build / maven (push) Successful in 7m35s
2026-11-10 15:27:45 +00:00
james.maesandClaude Fable 5.2 2837f4152a fix(upload-journal): accept Amazon Aurora PostgreSQL (full_page_writes=off)
maven / build (push) Successful in 9m8s
build / maven (push) Successful in 9m8s
The PostgreSQL 17 journal qualification refused every call on Amazon Aurora
PostgreSQL, which reports full_page_writes=off and does not expose the
parameter in its cluster parameter group.

- The settings query gains an eleventh column,
  to_regprocedure('aurora_version()') IS NOT NULL, which is true on Aurora,
  false on stock PostgreSQL 17 and never raises.
- full_page_writes=off is accepted only when that column is true. Stock
  PostgreSQL with full_page_writes=off is still refused, and synchronous_commit,
  fsync, recovery, isolation, time zone and lock timeout are unchanged on Aurora.
- The decision is the pure function tornPagesPrevented, covered by an always-on
  unit test. The opt-in real PostgreSQL 17 suite simulates Aurora with a
  function named aurora_version() and full_page_writes=off on the server.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-09 20:26:14 -06:00
+1 -1
View File
@@ -21,7 +21,7 @@
<!-- Only the published Redis API package is a permitted cross-qbit boundary. -->
<qbit.guardrails.allowedApiPackages>com.kingsrook.qbits.objectstorage.api,com.kingsrook.qbits.email.api,com.kingsrook.qbits.redis.api</qbit.guardrails.allowedApiPackages>
<qbit.guardrails.allowedQbitArtifacts>com.kingsrook.qbits:qbit-object-storage,com.kingsrook.qbits:qbit-email,com.kingsrook.qbits:*-api,com.kingsrook.qbits:qbit-redis</qbit.guardrails.allowedQbitArtifacts>
<revision>1.2.0-RC.5</revision>
<revision>1.2.0-SNAPSHOT</revision>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<jacoco.version>0.8.15</jacoco.version>