Skip to content

[sync] Merge pull request #2575 from teableio/feat/computed-activity-metadata#3613

Open
tea-artist wants to merge 1 commit into
developfrom
sync/ee-20260718-094732
Open

[sync] Merge pull request #2575 from teableio/feat/computed-activity-metadata#3613
tea-artist wants to merge 1 commit into
developfrom
sync/ee-20260718-094732

Conversation

@tea-artist

Copy link
Copy Markdown
Contributor

🔄 Automated sync from EE repository.

1 commit(s) synced since last sync.

Authors

Included commits

Latest source commit: teableio/teable-ee@ed70fdd

This PR was automatically created by the sync workflow.

…metadata

Synced from teableio/teable-ee@ed70fdd

Co-authored-by: nichenqin <nichenqin@hotmail.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bf4abdafef

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +264 to +268
for (const { doc, onOp } of listeners) {
doc.removeListener('op', onOp);
doc.removeListener('op batch', onOp);
doc.removeListener('create', onOp);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Unsubscribe ShareDB docs during cleanup

When the table/field list changes or this provider unmounts, this cleanup only removes local listeners; the doc.subscribe() calls above remain active. Since this effect subscribes to every readable field doc, navigating between tables or reloading field metadata accumulates ShareDB subscriptions that continue receiving cmp_* traffic and holding server/client resources even though the UI no longer observes them. Call doc.unsubscribe()/doc.destroy() (and do the same for the table doc cleanup) when tearing down the effect.

Useful? React with 👍 / 👎.

tableId: string,
ids: string[]
): Promise<ISnapshotBase<unknown>[]> {
await this.fieldService.authorizeComputedActivityRead(tableId);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Validate field ids before returning share activity docs

On share-link connections this authorizes only the table, but the ids passed to loadComputedActivitySnapshots come directly from the ShareDB subscription. Unlike getFieldSnapshotBulk, which validates requested ids through the share's allowed field list, a view share with hidden fields or visibleFieldIds can request cmp_${tableId} for a hidden field id and receive its compute status/error metadata. Please filter or validate these ids against the share's readable field ids before loading docs.

Useful? React with 👍 / 👎.

Comment on lines +101 to +102
fields: snapshot.fields.map((field) => ({
fieldId: field.fieldId,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Filter compute activity fields by field permissions

When a caller has table-read access but some fields are hidden or record-read denied, this response still serializes every projected activity row for the table after GetComputeActivityHandler only runs the table read guard. That exposes hidden field ids plus status/error/dirty-record metadata through /api/v2/tables/getComputeActivity, even though the UI has to filter canReadFieldRecord before subscribing or displaying activity. Filter snapshot.fields to the table fields the caller may read before mapping them here.

Useful? React with 👍 / 👎.

@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 29639757594

Coverage increased (+0.007%) to 58.902%

Details

  • Coverage increased (+0.007%) from the base build.
  • Patch coverage: 116 uncovered changes across 9 files (35 of 151 lines covered, 23.18%).
  • 4 coverage regressions across 3 files.

Uncovered Changes

File Changed Covered %
apps/nestjs-backend/src/share-db/share-db.spec.ts 48 0 0.0%
apps/nestjs-backend/src/features/v2/v2.controller.compute-activity.spec.ts 26 0 0.0%
apps/nestjs-backend/src/features/share/share-socket.service.spec.ts 10 0 0.0%
apps/nestjs-backend/src/features/v2/v2-container.service.ts 11 1 9.09%
apps/nestjs-backend/src/share-db/share-db.adapter.ts 33 26 78.79%
apps/nestjs-backend/src/share-db/readonly/field-readonly.service.ts 6 0 0.0%
apps/nestjs-backend/src/features/v2/v2.controller.ts 10 5 50.0%
apps/nestjs-backend/src/features/share/share.controller.ts 2 0 0.0%
apps/nestjs-backend/src/features/v2/v2-container.service.spec.ts 2 0 0.0%
Total (11 files) 151 35 23.18%

Coverage Regressions

4 previously-covered lines in 3 files lost coverage.

File Lines Losing Coverage Coverage
apps/nestjs-backend/src/share-db/share-db.adapter.ts 2 65.63%
apps/nestjs-backend/src/features/base/base-import.service.ts 1 83.57%
apps/nestjs-backend/src/features/v2/v2.controller.ts 1 30.43%

Coverage Stats

Coverage Status
Relevant Lines: 60083
Covered Lines: 35390
Line Coverage: 58.9%
Relevant Branches: 10344
Covered Branches: 8127
Branch Coverage: 78.57%
Branches in Coverage %: No
Coverage Strength: 3004.02 hits per line

💛 - Coveralls

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants