Skip to content

Write commands: target resolved twice, stale usernames, ignored flags #217

Closed

Description

@ertembiyik

A review of the open write-command PRs (edit, delete, forward, pin) pointed at four things in shared code on main. They affect tg send too.

  1. The access guard and the command resolve the account and the chat separately (src/commands/access.ts, then the command). If the active account changes in between, --chat me is checked on one account and executed on another.
  2. A cached username can outlive its owner (src/commands/send/peer-resolver.ts). If @name moved to another chat, a write goes to the previous one. Worst for delete.
  3. Flags a command does not declare are ignored, and a value after a boolean flag is dropped (--revoke false was read as --revoke). feat(messages): delete messages with tg messages delete #190 guards its own command; a shared check would cover the rest.
  4. The activity log write after a successful request (src/utils/telegram-rate-limits.ts) can throw and turn a done write into a failure; a retry then repeats it.

Happy to take any of these.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions