Skip to content

fix: restore document embedding for AstraDB - #6654

Merged
timothycarambat merged 2 commits into
Mintplex-Labs:masterfrom
MarMarLabs:fix/astra-collection-exists
Oct 7, 2026
Merged

timothycarambat merged 2 commits into
Mintplex-Labs:masterfrom
MarMarLabs:fix/astra-collection-exists

Conversation

@MarMarLabs

Copy link
Copy Markdown
Contributor

Embedding into AstraDB failed for every document with this.logger is not a function. The module-level collectionExists helper still called AstraDB.allNamespaces(client) after #4787 made allNamespaces an instance method, and its catch called this.logger outside the class.

The helper now takes the provider instance as its first argument and calls allNamespaces and logger on it. The one call site in getOrCreateCollection passes this. Nothing else in the file uses the helper.

I ran the real provider and the @datastax/astra-db-ts client against a local stand-in for the Data API, embedding two documents into workspace sales:

                              master        this branch
documents vectorized          0 of 2        2 of 2
ns_sales collection           not created   2 rows
createCollection requests     0             1

Both the cached-vector path and the fresh embed path fail this way on master and pass on this branch.

Swapping only this.logger for console.log is not enough. Embedding then succeeds, but the existence check still throws and returns false, so a createCollection request goes out for every document and the TypeError is logged each time.

No test was added, since there is no Astra test suite and a test here would only exercise a mocked Data API. The server test suite passes unchanged, and prettier and eslint pass on the file.

Closes #6653

MarMarLabs and others added 2 commits October 6, 2026 23:50
Every document embedded into an AstraDB workspace failed with "this.logger is not a function", and no collection was ever created. The collection check called allNamespaces on the AstraDB class instead of an instance, and its error handler then threw because it used this outside the class. The check now receives the provider instance and uses it for both the lookup and the log.
@timothycarambat
timothycarambat merged commit 4323a8f into Mintplex-Labs:master Oct 7, 2026
6 checks passed
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.

[BUG]: AstraDB fails to embed every document with "this.logger is not a function"

2 participants