Skip to content

Using uuid instead of crypto.randomUuid#28990

Merged
Rohit0301 merged 3 commits into
mainfrom
context-center-upload-document-issue
Jun 12, 2026
Merged

Using uuid instead of crypto.randomUuid#28990
Rohit0301 merged 3 commits into
mainfrom
context-center-upload-document-issue

Conversation

@Rohit0301

@Rohit0301 Rohit0301 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Describe your changes:

The UploadDocumentModal crashed when a file was selected in AUT.
Error - TypeError: crypto.randomUUID is not a function
crypto.randomUUID is a Web Crypto API that is only available in secure contexts (HTTPS or localhost). AUT environments run over HTTP, so the call throws immediately on file selection, preventing the upload flow from completing.

Screenshot 2026-06-12 at 12 09 38 PM

Fixes #

I worked on ... because ...

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

High-level design:

N/A — small change.

Tests:

Use cases covered

Unit tests

Backend integration tests

Ingestion integration tests

Playwright (UI) tests

Manual testing performed

UI screen recording / screenshots:

Not applicable.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.
  • For UI changes: I attached a screen recording and/or screenshots above.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

Summary by Gitar

  • Refactored UUID generation:
    • Replaced crypto.randomUUID() with uuidv4() from the uuid package in UploadDocumentModal.component.tsx for consistent ID generation.
  • Updated Playwright tests:
    • Simplified the test implementation in ContextCenter.spec.ts by defining a standard uploadFile object and streamlining the file upload interaction.

This will update automatically on new commits.

@Rohit0301 Rohit0301 self-assigned this Jun 12, 2026
@Rohit0301 Rohit0301 requested a review from a team as a code owner June 12, 2026 06:45
@Rohit0301 Rohit0301 added safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check labels Jun 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 62%
62.44% (67088/107431) 43.94% (37140/84513) 45.82% (11474/25038)

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (13 flaky)

✅ 4301 passed · ❌ 0 failed · 🟡 13 flaky · ⏭️ 88 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 299 0 2 4
🟡 Shard 2 809 0 3 9
🟡 Shard 3 811 0 1 8
🟡 Shard 4 847 0 3 12
🟡 Shard 5 733 0 1 47
🟡 Shard 6 802 0 3 8
🟡 13 flaky test(s) (passed on retry)
  • Flow/Tour.spec.ts › Tour should work from help section (shard 1, 1 retry)
  • Pages/Roles.spec.ts › Roles page should work properly (shard 1, 1 retry)
  • Features/ContextCenter.spec.ts › version page shows article version header with breadcrumb and title (shard 2, 1 retry)
  • Features/DataProductPersonaCustomization.spec.ts › Data Product - customize tab label should only render if it's customized by user (shard 2, 1 retry)
  • Features/Glossary/GlossaryP3Tests.spec.ts › should handle multiple rapid API calls (shard 2, 1 retry)
  • Features/RTL.spec.ts › Verify Following widget functionality (shard 3, 1 retry)
  • Flow/PersonaFlow.spec.ts › Set default persona for team should work properly (shard 4, 1 retry)
  • Pages/CustomProperties.spec.ts › Enum (shard 4, 1 retry)
  • Pages/CustomProperties.spec.ts › Should search custom properties for apiCollection in right panel (shard 4, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.ts › Should remove user owner for knowledgeCenter (shard 5, 1 retry)
  • Pages/Lineage/DataAssetLineage.spec.ts › Column lineage for mlModel -> table (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/UserDetails.spec.ts › Create team with domain and verify visibility of inherited domain in user profile after team removal (shard 6, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@Rohit0301 Rohit0301 enabled auto-merge (squash) June 12, 2026 10:50
@Rohit0301 Rohit0301 merged commit 0259a9a into main Jun 12, 2026
56 of 57 checks passed
@Rohit0301 Rohit0301 deleted the context-center-upload-document-issue branch June 12, 2026 10:50
@gitar-bot

gitar-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Replaces crypto.randomUUID() with the uuid package in the document upload modal for consistent ID generation. No issues found.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

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

Labels

safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants