formatting, pin and export - #100
Conversation
|
deployed at https://t.me/TeleOTPAppBot/preview ❗BREAKING❗if you change credentials in the preview app, they won't work in the stable one (don't ask me how I know). |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 48b41d6f7c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "jsdom": "^30.0.1", | ||
| "protobufjs-cli": "^2.6.1", | ||
| "typescript": "^7.0.2", | ||
| "vite": "^8.1.5", |
There was a problem hiding this comment.
Use a Node version supported by Vite 8
The Pages workflow in .github/workflows/deploy.yml selects Node 18 and then invokes npm run build, but the newly pinned Vite 8.1.5 and React plugin require Node ^20.19.0 || >=22.12.0 according to package-lock.json. Consequently, every main-branch deployment runs the new build tool on an unsupported runtime and can fail before uploading the Pages artifact; update the workflow's Node version or retain Node-18-compatible tooling.
Useful? React with 👍 / 👎.
| "version": "0.1.0", | ||
| "type": "module", | ||
| "scripts": { | ||
| "deploy": "tgcloud push", |
There was a problem hiding this comment.
Replace the obsolete Docker bot deployment workflow
On the next main push or manual run, .github/workflows/bot.yml still invokes docker/build-push-action with file: ./bot/Dockerfile, although this commit deletes that file and replaces the bot with this tgcloud deployment script. The workflow therefore fails before deploying the new handler; update it to install the bot dependency and run this script with TGCLOUD_TOKEN.
AGENTS.md reference: bot/AGENTS.md:L76-L82
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9d7dca3539
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| [Payload.OtpParameters.Algorithm.ALGORITHM_MD5]: "MD5", | ||
| [Payload.OtpParameters.Algorithm.ALGORITHM_UNSPECIFIED]: undefined, | ||
| })[otp.algorithm] : undefined, | ||
| secret: new Secret({ buffer: otp.secret.buffer }), |
There was a problem hiding this comment.
Pass only the decoded secret bytes to Secret
When importing any protobuf migration payload, otp.secret is a Uint8Array view into the encoded message, so otp.secret.buffer refers to the entire underlying migration buffer rather than just the secret's byte range. The resulting TOTP includes protobuf framing and possibly other accounts in its secret, producing codes that do not match the source authenticator; copy the view or preserve its byteOffset and byteLength before constructing Secret.
Useful? React with 👍 / 👎.
| icon: otp.icon ?? "key", | ||
| uri: totp.toString(), | ||
| order: -1, | ||
| order, |
There was a problem hiding this comment.
Preserve global order across imported batches
When a multi-batch export is imported one QR code or link at a time, every batch assigns orders starting at zero. saveAccounts then merges these accounts with earlier batches and sorts by order, so two batches [A, B] and [C, D] become [A, C, B, D] rather than the exported order; incorporate the batch position or append each later batch after the existing accounts.
Useful? React with 👍 / 👎.
| if ( | ||
| currentBatch.length > 0 && | ||
| serialize(candidateData).length > maxLength | ||
| ) { |
There was a problem hiding this comment.
Reject single accounts that exceed export limits
If one account's serialized data already exceeds maxLength—for example due to an imported or user-entered long label or issuer—the overflow condition is skipped because currentBatch is empty, and that oversized account is returned as a one-item batch. LinkExport consequently produces a startapp value beyond its configured 512-character limit, making that export unusable; detect this case and report it or provide another export path.
Useful? React with 👍 / 👎.
No description provided.