Skip to content

truncateMessage's default length is unrelated to the contract's limit #10

Description

@Abioladory123

Summary

truncateMessage defaults to 80 characters. The contract caps a tip message at
280 bytes, and the frontend enforces its own separate number. Three layers, three
unrelated values, none deriving from the others.

80 may be a perfectly reasonable display default, but as an unexplained literal
it reads like a limit rather than a display choice, and there is nothing
connecting it to what the contract actually permits.

Acceptance criteria

  • The default is either derived from an exported message-length constant or
    documented as a display-only choice with its reasoning.
  • The relationship to the contract's byte limit is stated in the doc
    comment, including that one counts bytes and the other characters.
  • Tests cover a message at the boundary and one past it.

Getting started

Fork this repository, clone your fork, and add this repo as upstream:

git clone https://github.com/<your-username>/novatip-sdk.git
cd novatip-sdk
git remote add upstream https://github.com/Novatip/novatip-sdk.git
npm install

Create a branch for this issue:

git checkout -b fix/truncate-message-default

Suggested commit message:

fix: relate the truncation default to the message limit

Run npm run lint, npm run typecheck, and npm run build before pushing, then open a pull request from your fork against main and link this issue. See the contributing guide for the full workflow.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions