Skip to content

formatting, pin and export - #100

Merged
LowderPlay merged 16 commits into
mainfrom
dev
Jul 30, 2026
Merged

formatting, pin and export#100
LowderPlay merged 16 commits into
mainfrom
dev

Conversation

@LowderPlay

Copy link
Copy Markdown
Contributor

No description provided.

@LowderPlay
LowderPlay marked this pull request as draft July 29, 2026 17:03
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 29, 2026

Copy link
Copy Markdown

Deploying teleotp with  Cloudflare Pages  Cloudflare Pages

Latest commit: fa4a8e0
Status:⚡️  Build in progress...

View logs

@LowderPlay LowderPlay changed the title formatting and export formatting, pin and export Jul 29, 2026
@LowderPlay
LowderPlay marked this pull request as ready for review July 29, 2026 22:30
@LowderPlay

LowderPlay commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

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).

@LowderPlay

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread package.json
"jsdom": "^30.0.1",
"protobufjs-cli": "^2.6.1",
"typescript": "^7.0.2",
"vite": "^8.1.5",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment thread bot/package.json
"version": "0.1.0",
"type": "module",
"scripts": {
"deploy": "tgcloud push",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@LowderPlay

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/migration/import.ts
[Payload.OtpParameters.Algorithm.ALGORITHM_MD5]: "MD5",
[Payload.OtpParameters.Algorithm.ALGORITHM_UNSPECIFIED]: undefined,
})[otp.algorithm] : undefined,
secret: new Secret({ buffer: otp.secret.buffer }),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment thread src/migration/import.ts
icon: otp.icon ?? "key",
uri: totp.toString(),
order: -1,
order,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread src/migration/export.ts
Comment on lines +86 to +89
if (
currentBatch.length > 0 &&
serialize(candidateData).length > maxLength
) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@LowderPlay
LowderPlay merged commit 3dedd3b into main Jul 30, 2026
@LowderPlay
LowderPlay deleted the dev branch July 30, 2026 21:16
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.

1 participant