Skip to content

[sync] fix: preserve select lookup choices on lookupOptions update (T6208)#3603

Open
tea-artist wants to merge 1 commit into
developfrom
sync/ee-20260715-162942
Open

[sync] fix: preserve select lookup choices on lookupOptions update (T6208)#3603
tea-artist wants to merge 1 commit into
developfrom
sync/ee-20260715-162942

Conversation

@tea-artist

Copy link
Copy Markdown
Contributor

🔄 Automated sync from EE repository.

2 commit(s) synced since last sync.

Authors

Included commits

  • fix: preserve select lookup choices on lookupOptions update (T6208) (nichenqin)
  • feat: add structured logs for user rename and invitation emails (T6212) (Aries X)

Latest source commit: teableio/teable-ee@76cba02

This PR was automatically created by the sync workflow.

…6208)

Synced from teableio/teable-ee@76cba02

Co-authored-by: Aries X <caoxing9@gmail.com>
Co-authored-by: nichenqin <nichenqin@hotmail.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

1 similar comment
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@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: a94edc2034

ℹ️ 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".

// Prefer request options when present; otherwise fall back to previous
// options so showAs/formatting survive. prepareLookupField still mirrors
// source choices via prepareFormattingShowAs.
options: fieldRo.options ?? oldFieldVo.options,

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 Avoid carrying stale showAs into lookup cardinality changes

When a lookup's linkFieldId changes from a single-value link to a multi-value link and the client omits options, this fallback feeds the old options into prepareFormattingShowAs. A previously valid single-number showAs such as ring is then retained, but validateFormattingShowAs validates the updated lookup against the multi-number schema and rejects the conversion. The previous changed-lookup path rebuilt from fieldRo without carrying old options, so this blocks legitimate lookup target/cardinality changes unless callers know to send options: {}.

Useful? React with 👍 / 👎.

// options / sends null while only updating lookupOptions (T6208).
const mergedLookupOptions =
newLookupOptions && oldLookupOptions
? { ...oldLookupOptions, ...newLookupOptions }

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 Clear stale lookup filters when switching lookup targets

When a lookup already has a filter and the client switches linkFieldId/foreignTableId/lookupFieldId without sending a new filter, this shallow merge preserves the old filter on the new lookup target. That regresses the previous changed-target path, which rebuilt from fieldRo and dropped omitted filters, and can leave filters that reference fields from the old foreign table so the converted lookup stays unexpectedly filtered or later queries against invalid field ids.

Useful? React with 👍 / 👎.


return this.prepareLookupField(tableId, fieldRo);
return this.prepareLookupField(tableId, {
...oldFieldVo,

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 Clear stale lookup error state on repair

When an errored lookup is repaired by converting it to a valid lookupOptions target, spreading oldFieldVo into the object passed to prepareLookupField carries the old hasError flag forward, and the normal lookup preparation path does not clear it. The transaction may later repair the persisted flag via restoreReference, but the newField object used for the API response and OPERATION_FIELD_CONVERT event still reports hasError: true, so clients can keep showing the field as broken immediately after a successful repair; the previous changed-target path rebuilt from fieldRo and did not carry this stale state.

Useful? React with 👍 / 👎.

@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 29432643754

Coverage decreased (-4.9%) to 54.058%

Details

  • Coverage decreased (-4.9%) from the base build.
  • Patch coverage: 1 uncovered change across 1 file (17 of 18 lines covered, 94.44%).
  • 2955 coverage regressions across 145 files.

Uncovered Changes

File Changed Covered %
apps/nestjs-backend/src/features/field/field-calculate/field-supplement.service.ts 16 15 93.75%
Total (3 files) 18 17 94.44%

Coverage Regressions

2955 previously-covered lines in 145 files lost coverage.

Top 10 Files by Coverage Loss Lines Losing Coverage Coverage
apps/nestjs-backend/src/db-provider/select-query/postgres/select-query.postgres.ts 227 58.55%
apps/nestjs-backend/src/features/selection/selection.service.ts 198 42.06%
apps/nestjs-backend/src/features/table/table-duplicate.service.ts 185 28.85%
apps/nestjs-backend/src/features/record/query-builder/sql-conversion.visitor.ts 182 61.11%
apps/nestjs-backend/src/features/record/open-api/record-open-api-v2.service.ts 130 58.55%
apps/nestjs-backend/src/features/v2/v2-record-history.service.ts 125 17.73%
apps/nestjs-backend/src/features/integrity/integrity-v2.service.ts 115 42.18%
apps/nestjs-backend/src/features/field/field-calculate/field-converting.service.ts 111 70.73%
apps/nestjs-backend/src/features/base-node/base-node.service.ts 82 58.04%
apps/nestjs-backend/src/features/space/space-data-db-copy.service.ts 82 12.24%

Coverage Stats

Coverage Status
Relevant Lines: 59484
Covered Lines: 32156
Line Coverage: 54.06%
Relevant Branches: 10276
Covered Branches: 7440
Branch Coverage: 72.4%
Branches in Coverage %: No
Coverage Strength: 2325.52 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.

3 participants