Conversation
📝 WalkthroughWalkthroughThis PR implements a login transfer feature for Hotstar that allows users to export authentication cookies as an encoded payload and import them on separate devices. It adds cookie transfer utility modules, updates the OTT modal UI with export/import workflows, introduces new background message handlers, and enables the cookies permission in the manifest. Changes
Sequence Diagram(s)sequenceDiagram
participant User as User
participant UI as OTTModal UI
participant Bg as Background Worker
participant API as Browser Cookies API
rect rgba(100, 150, 200, 0.5)
Note over User,API: Export Flow
User->>UI: Click "Export Login"
UI->>Bg: Send EXPORT_COOKIES message
Bg->>API: Query cookies for Hotstar URL
API-->>Bg: Return cookie list
Bg->>Bg: Filter, serialize, encode payload
Bg-->>UI: Return encoded payload
UI->>UI: Display payload & copy button
User->>UI: Copy to clipboard
end
rect rgba(150, 100, 200, 0.5)
Note over User,API: Import Flow (on new device)
User->>UI: Paste payload & click "Import"
UI->>Bg: Send IMPORT_COOKIES message + payload
Bg->>Bg: Decode & validate payload
Bg->>API: Set each cookie
API-->>Bg: Confirm cookie set
Bg-->>UI: Return import results
UI->>UI: Display success/failure feedback
end
Estimated Code Review Effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
src/lib/cookie-transfer-background.ts (1)
98-100: Consider logging failed cookie errors for debugging.The error is silently swallowed, making it difficult to diagnose why specific cookies failed to import. Adding a debug log would help troubleshoot issues.
} catch { + // Consider: logger.debug("Failed to import cookie", { name: cookie.name, error }); failedCookies.push(cookie.name); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/lib/cookie-transfer-background.ts` around lines 98 - 100, The catch block currently swallows errors and only calls failedCookies.push(cookie.name); update the catch to log the error (e.g., console.error or your module logger) including cookie.name and the caught error so failures are visible for debugging; specifically modify the catch around failedCookies.push(cookie.name) in src/lib/cookie-transfer-background.ts to accept an error parameter (catch (err) { ... }) and emit a clear log message before pushing the cookie name to failedCookies.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.changeset/quick-yaks-feel.md:
- Line 5: The changelog entry contains a typo: update the commit message string
"feat: login trasfer on hotstar" to correct spelling by replacing "trasfer" with
"transfer" so it reads "feat: login transfer on hotstar".
In `@lefthook.yml`:
- Around line 1-11: The lefthook.yml currently has the pre-commit and pre-push
blocks commented out, disabling automated Biome lint checks; restore the
pre-commit and pre-push sections by uncommenting the blocks for the "check"
command(s) (the pre-commit "check" using npx `@biomejs/biome` with {staged_files}
and stage_fixed: true, and the pre-push "check" using bunx `@biomejs/biome` with
{push_files}) or, if disabling is intentional, add a top-line comment or PR note
confirming that decision; ensure the commands (check, glob pattern, run,
stage_fixed) are exactly present in lefthook.yml so hooks run on commit/push as
intended.
In `@src/components/OTTModal.tsx`:
- Line 292: Fix the button label typo in the OTTModal component: inside the JSX
that renders the import button (the conditional using isTransferBusy), remove
the extra spaces in the fallback string so it reads "Import Session" instead of
"Import Session" to ensure consistent button text when isTransferBusy is
false.
---
Nitpick comments:
In `@src/lib/cookie-transfer-background.ts`:
- Around line 98-100: The catch block currently swallows errors and only calls
failedCookies.push(cookie.name); update the catch to log the error (e.g.,
console.error or your module logger) including cookie.name and the caught error
so failures are visible for debugging; specifically modify the catch around
failedCookies.push(cookie.name) in src/lib/cookie-transfer-background.ts to
accept an error parameter (catch (err) { ... }) and emit a clear log message
before pushing the cookie name to failedCookies.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 0d48fe06-b689-468c-a05e-6f502aca038c
📒 Files selected for processing (8)
.changeset/quick-yaks-feel.mdlefthook.ymlsrc/components/OTTModal.tsxsrc/entrypoints/background.tssrc/lib/cookie-transfer-background.tssrc/lib/cookie-transfer.tssrc/lib/messaging.tswxt.config.ts
| "OTTPRO": patch | ||
| --- | ||
|
|
||
| feat: login trasfer on hotstar |
There was a problem hiding this comment.
Typo: "trasfer" → "transfer"
-feat: login trasfer on hotstar
+feat: login transfer on hotstar📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| feat: login trasfer on hotstar | |
| feat: login transfer on hotstar |
🧰 Tools
🪛 LanguageTool
[grammar] ~5-~5: Ensure spelling is correct
Context: --- "OTTPRO": patch --- feat: login trasfer on hotstar
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.changeset/quick-yaks-feel.md at line 5, The changelog entry contains a
typo: update the commit message string "feat: login trasfer on hotstar" to
correct spelling by replacing "trasfer" with "transfer" so it reads "feat: login
transfer on hotstar".
| # pre-commit: | ||
| # commands: | ||
| # check: | ||
| # glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}" | ||
| # run: npx @biomejs/biome check --write --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {staged_files} | ||
| # stage_fixed: true | ||
| # pre-push: | ||
| # commands: | ||
| # check: | ||
| # glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}" | ||
| # run: bunx @biomejs/biome check --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {push_files} |
There was a problem hiding this comment.
All git hooks are disabled.
Commenting out pre-commit and pre-push hooks removes automated quality checks (Biome linting). Consider re-enabling before merging to master, or confirm this is intentional.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@lefthook.yml` around lines 1 - 11, The lefthook.yml currently has the
pre-commit and pre-push blocks commented out, disabling automated Biome lint
checks; restore the pre-commit and pre-push sections by uncommenting the blocks
for the "check" command(s) (the pre-commit "check" using npx `@biomejs/biome` with
{staged_files} and stage_fixed: true, and the pre-push "check" using bunx
`@biomejs/biome` with {push_files}) or, if disabling is intentional, add a
top-line comment or PR note confirming that decision; ensure the commands
(check, glob pattern, run, stage_fixed) are exactly present in lefthook.yml so
hooks run on commit/push as intended.
| onClick={handleImportSession} | ||
| type="button" | ||
| > | ||
| {isTransferBusy ? "Importing..." : "Import Session"} |
There was a problem hiding this comment.
Typo: Extra spaces in button text.
- {isTransferBusy ? "Importing..." : "Import Session"}
+ {isTransferBusy ? "Importing..." : "Import Session"}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| {isTransferBusy ? "Importing..." : "Import Session"} | |
| {isTransferBusy ? "Importing..." : "Import Session"} |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/components/OTTModal.tsx` at line 292, Fix the button label typo in the
OTTModal component: inside the JSX that renders the import button (the
conditional using isTransferBusy), remove the extra spaces in the fallback
string so it reads "Import Session" instead of "Import Session" to ensure
consistent button text when isTransferBusy is false.
Summary by CodeRabbit
New Features
Chores