fix: auto-generate collectionName to fix HTTP context errors#36
Merged
shubham3121 merged 1 commit intomainfrom Jan 29, 2026
Merged
fix: auto-generate collectionName to fix HTTP context errors#36shubham3121 merged 1 commit intomainfrom
shubham3121 merged 1 commit intomainfrom
Conversation
crypto.randomUUID() is only available in secure contexts (HTTPS/localhost). Users accessing the app over HTTP would get "crypto.randomUUID is not a function" errors when creating datasets. Move UUID generation to the backend, making collectionName optional in the API. The backend now auto-generates a unique identifier if not provided.
There was a problem hiding this comment.
Pull request overview
This pull request fixes a browser security context error where crypto.randomUUID() fails when users access the application over plain HTTP (non-secure contexts). The fix moves UUID generation responsibility from the frontend to the backend for dataset collection names.
Changes:
- Removed frontend-side UUID generation using
crypto.randomUUID()from dataset creation flows - Made
collectionNameoptional in the dataset creation API - Backend now auto-generates a UUID for
collectionNamewhen not provided during validation
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
frontend/src/composables/useDataEndpointCreation.ts |
Removed generateCollectionName helper function and stopped passing auto-generated collectionName in dataset configuration |
frontend/src/components/CreateDatasetDialogSimple.vue |
Removed generateCollectionName helper function and stopped passing auto-generated collectionName in dataset configuration |
frontend/src/api/types/index.ts |
Made collectionName optional in CreateDatasetRequest interface |
backend/syft_space/components/dataset_types/weaviate_local/weaviate_type.py |
Added UUID import, updated schema to make collectionName optional, auto-generates UUID in validation when not provided, and updated schema description |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
backend/syft_space/components/dataset_types/weaviate_local/weaviate_type.py
Show resolved
Hide resolved
shubham3121
approved these changes
Jan 29, 2026
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.
Summary
collectionNameoptional in the dataset creation APIcollectionNameis not providedProblem
crypto.randomUUID()is a Web API that only works in secure contexts (HTTPS or localhost). Users accessing the app via HTTP on a local network (e.g.,http://192.168.x.x:8080) would encounter this error when creating datasets.Solution
Move the UUID generation responsibility from the frontend to the backend, where it always works regardless of the client's security context.
Test plan