Skip to content

Messages: honor GET /api/limits and handle subscriber/verification gates #37

Open

Description

@Adron

Summary

The server publishes its own media and content limits; the app hard-codes nothing and validates nothing, so an oversized upload fails server-side with a generic error.

Live verification (2026-09-15)

GET /api/limits -> 200
{"media":{"image":{"maxBytes":1468006,"maxPixels":1200,"acceptedFormats":["jpeg","png","gif","webp"]},
          "video":{"maxBytes":3145728,"acceptedFormats":["mp4","mov"]}},
 "message":{"maxContentLength":5000}}

Gates to handle as first-class states, not generic errors

From /help/account:

  • Email must be verified before posting messages or attaching media (emailVerified on GET /api/user).
  • Account status new (on probation) locks DMs, image/video upload, cross-posting, scheduled posts, and creating lists/documents/organizations, with a few posts per hour.
  • Media, cross-posting and scheduling are Subscriber features (customerStatus).
  • Effective message length is the caller's own maxMessageLength (GET /api/user), which may be below the server cap.

Acceptance criteria

  • GetLimitsAsync added and cached for the session.
  • The file picker filters to acceptedFormats; oversized or over-dimension files are rejected client-side with the actual limit quoted.
  • Composer counter uses min(user.maxMessageLength, limits.message.maxContentLength).
  • 402/403 on a gated action renders an upgrade-needed or verify-email state naming the reason.
  • Media/cross-post/schedule controls are disabled with an explanation when the account status or tier forbids them.
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

    P1area:messagesparity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions