Repository navigation
feat(audit-trail): filter the per-record history by operation [PRD-1256] - #1910
Merged
bexchauveto merged 4 commits intoSep 30, 2026
Conversation
|
Coverage Impact This PR will not change total coverage. Modified Files with Diff Coverage (2)
🛟 Help
|
bexchauveto
added this pull request to stack #1913
September 22, 2026 07:15
bexchauveto
force-pushed
the
feature/prd-1256-agent-nodejs-operation-filter-on-the-audit-trail-route
branch
2 times, most recently
from
September 22, 2026 07:55
f2a4f40 to
5192d43
Compare
1 new issue
|
bexchauveto
force-pushed
the
feature/prd-1256-agent-nodejs-operation-filter-on-the-audit-trail-route
branch
2 times, most recently
from
September 22, 2026 08:19
b1b6ca5 to
3f62633
Compare
bexchauveto
force-pushed
the
feature/prd-1256-agent-nodejs-operation-filter-on-the-audit-trail-route
branch
from
September 22, 2026 09:35
3f62633 to
4280bc9
Compare
Member
Author
bexchauveto
removed this pull request from stack #1913
September 22, 2026 12:05
bexchauveto
added this pull request to stack #1915
September 22, 2026 12:06
bexchauveto
force-pushed
the
feature/prd-1256-agent-nodejs-operation-filter-on-the-audit-trail-route
branch
from
September 22, 2026 12:38
4280bc9 to
8f7c4e3
Compare
bexchauveto
force-pushed
the
feature/prd-1256-agent-nodejs-operation-filter-on-the-audit-trail-route
branch
from
September 23, 2026 09:14
8f7c4e3 to
b59c691
Compare
bexchauveto
force-pushed
the
feature/prd-1256-agent-nodejs-operation-filter-on-the-audit-trail-route
branch
from
September 23, 2026 09:36
b59c691 to
1b88437
Compare
bexchauveto
force-pushed
the
feature/prd-1256-agent-nodejs-operation-filter-on-the-audit-trail-route
branch
4 times, most recently
from
September 23, 2026 13:20
a2f6e57 to
665192b
Compare
bexchauveto
force-pushed
the
feature/prd-1256-agent-nodejs-operation-filter-on-the-audit-trail-route
branch
4 times, most recently
from
September 24, 2026 13:23
b523206 to
cd2e1be
Compare
bexchauveto
force-pushed
the
feature/prd-1256-agent-nodejs-operation-filter-on-the-audit-trail-route
branch
4 times, most recently
from
September 24, 2026 15:16
7cb26a6 to
e325674
Compare
Base automatically changed from
feature/prd-1265-agent-nodejs-only-evaluate-the-audit-scope-against-a
to
main
September 24, 2026 15:22
bexchauveto
force-pushed
the
feature/prd-1256-agent-nodejs-operation-filter-on-the-audit-trail-route
branch
6 times, most recently
from
September 25, 2026 12:42
db8e02e to
7d7c00d
Compare
bexchauveto
force-pushed
the
feature/prd-1256-agent-nodejs-operation-filter-on-the-audit-trail-route
branch
from
September 28, 2026 14:50
250d416 to
744519f
Compare
bexchauveto
force-pushed
the
feature/prd-1256-agent-nodejs-operation-filter-on-the-audit-trail-route
branch
6 times, most recently
from
September 30, 2026 15:13
e243670 to
19f8e46
Compare
`GET /forest/_audit-trail/{collection}/{recordId}` accepts an `operation`
query param: comma-separated, from the closed set the agent stores
(`create`, `update`, `delete`, `action`, `action_failed`).
An unrecognized value returns 400 rather than being dropped. A silently
ignored filter returns unfiltered rows into a list the caller believes is
filtered — the failure mode this param exists to avoid.
Pushed into the store query rather than applied to the fetched page, so
`meta.count` and `meta.availableUsers` agree with the rows and paging stays
correct.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…gone scoped record Matched in SQL, `search` and `fields` test the values as captured, so the rows, `meta.count` and `availableUsers` would reveal whether a withheld value holds the term. For a record gone under a permission scope, the history is read without those two filters and matched and paged in memory against the values served. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ord deleted mid-request A record visible at the check but gone by the recheck had its rows, count and authors matched in SQL on captured values; that answer is now discarded and re-read against the served values. The served-value read runs in batches of 500, keeping only the requested page and the authors in memory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…kes a list The parameter accepts a comma-separated set and is read into `operations` everywhere behind the route, so the singular on the wire was the odd one out and read as though one value were all it would take. Nothing consumes it yet outside the front's own branch, so the rename costs no compatibility. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
bexchauveto
force-pushed
the
feature/prd-1256-agent-nodejs-operation-filter-on-the-audit-trail-route
branch
from
September 30, 2026 15:23
19f8e46 to
d533447
Compare
bexchauveto
deleted the
feature/prd-1256-agent-nodejs-operation-filter-on-the-audit-trail-route
branch
September 30, 2026 15:34
forest-bot
added a commit
that referenced
this pull request
Sep 30, 2026
# @forestadmin/agent [1.104.0](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/agent@1.103.9...@forestadmin/agent@1.104.0) (2026-09-30) ### Features * **audit-trail:** filter the per-record history by operation [PRD-1256] ([#1910](#1910)) ([92cd2f6](92cd2f6))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

fixes PRD-1256. Stacked on #1909 → #1908.
GET /forest/_audit-trail/{collection}/{recordId}accepts anoperationquery param.The contract (Ruby copies this verbatim)
operation(singular, likesearch; the store field isoperations)operation=create,delete— consistent withuserIdsandfieldscreate,update,delete,action,action_failedThat last one departs from
userIds, which drops junk tokens. Deliberate: a silently ignored filter returns unfiltered rows into a list the caller believes is filtered — the exact failure the ticket warns about.userIdscan afford to be lenient because a partial id list still filters; an ignoredoperationdoesn't filter at all.Empty or whitespace-only → no filter, same as
fields.Pushed into the query, not applied after
operationslands in the sharedfiltersobject, so it reacheslistByRecord,countByRecordandlistDistinctUsers.meta.countandmeta.availableUserstherefore agree with the rows, and paging stays correct — filtering the fetched page would have desynced all three.SQL side is one clause in
buildHistoryWhereClause; the in-memory test store gained the same filter so the double stays honest.Tests
6 route cases (single, comma-separated, count + author list, 400 on unknown, empty ignored) and a sql-store case covering
listByRecordandcountByRecordtogether.1651 passed, lint clean.🤖 Generated with Claude Code
Note
Add operation filter to audit-trail history and apply
search/fieldsafter permission withholdingoperationsfilter (create, update, delete, action, action_failed). Unknown values return a validation error; the filter is passed to the store for row, count, and author queries in audit-trail.ts and sql-store.ts.fieldsandsearchno longer match captured values. Instead, rows are read in batches of 500, permission withholding is applied, and matching runs in memory against served values, action, and user identity. Pagination, total count, and the first-page author list come from these served-value matches.search/fieldsnow return results based on post-withholding values, so search terms present only in withheld values produce no rows; seeAuditTrailRoute.listServedMatchesin audit-trail.ts.Macroscope summarized d533447.