Skip to content

refactor(plugins): share the document path resolver and refresh a stale Elasticsearch mapping - #2922

Merged
datlechin merged 1 commit into
mainfrom
fix/elasticsearch-shared-path-resolver
Sep 16, 2026
Merged

datlechin merged 1 commit into
mainfrom
fix/elasticsearch-shared-path-resolver

Conversation

@datlechin

Copy link
Copy Markdown
Member

Follow-up to #2905, which merged before these two review findings were addressed.

One document path resolver, not two

ElasticsearchMappingFlattener and TypesenseSchema each carried a character-for-character copy of the same dotted-path walker. Both now call DocumentPath.value(in:atPath:) in the new dependency-free TableProDocumentPath target, which both plugins and TableProTests link.

The shared version keeps the positional rule #2905 added on the Elasticsearch side: an element that lacks the key holds its place as null. Typesense dropped it, so variants.sku came back one entry shorter than variants.qty and the second sku read as the first variant's. That is a user-visible Typesense fix, so it has its own CHANGELOG line.

A stale mapping is refreshed

_mappingCache was filled once per index and only ever cleared on disconnect, so a PUT /index/_mapping typed in the console left the grid showing the old columns for the rest of the session, and a filter on a new field matched nothing. Any console request whose method is not GET or HEAD now drops the cache. ElasticsearchOperations.changesMapping(method:) holds that rule so it can be tested; the sidebar's Drop Index goes through it too, since it runs as DELETE /<index>.

Row writes do not invalidate: the generator only ever writes columns that came from the mapping, so dynamic mapping cannot add a field behind them.

An alias reports every index it covers

properties(fromMappingResponse:index:) fell back to response.values.first when the response was not keyed by the name asked for, which is every alias and every wildcard: one index's columns stood in for all of them. It now unions the fields of every index in the response, first declaration winning so the result does not depend on dictionary order.

Verification

  • verify.sh build, build ElasticsearchDriverPlugin, build TypesenseDriverPlugin: pass
  • verify.sh test over the Elasticsearch, Typesense and classifier suites: 263 passed, 0 failed
  • swift test --filter DocumentPathTests in Packages/TableProCore: 9 passed
  • verify.sh docs: pass

@mintlify

mintlify Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
TablePro 🟢 Ready View Preview Sep 16, 2026, 9:17 AM

💡 Tip: Enable Automations to automatically generate PRs for you.

@datlechin
datlechin merged commit 9abc72c into main Sep 16, 2026
7 of 8 checks passed
@datlechin
datlechin deleted the fix/elasticsearch-shared-path-resolver branch September 16, 2026 09:21

This branch was successfully deployed

1 active deployment
staging - docs — 42a9dd53 Deployed Sep 16, 2026 by mintlify[bot]
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.

1 participant