ci: truncate commit message before telegram upload#96
Conversation
sendDocument caption limit is 1024 chars. After backtick-stripping, long commit bodies still bust the limit and uploadCI.py fails with 400 Bad Request. Do both the strip and an 800-char cap in one Python step so the release notification survives verbose commits.
There was a problem hiding this comment.
Pull request overview
Updates the GitHub Actions release workflow to prevent Telegram upload failures caused by overly long commit messages and Markdown parsing issues, ensuring release notifications reliably send.
Changes:
- Replaces shell
trsanitization with an inline Python step to normalizeCOMMIT_MESSAGE. - Strips backticks/CR characters and truncates commit text to reduce the chance of exceeding Telegram’s caption limits.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if len(s) > MAX: | ||
| s = s[:MAX].rstrip() + "\n…(truncated)" |
There was a problem hiding this comment.
The truncation logic can produce a string longer than MAX because it slices to MAX and then appends the "…(truncated)" suffix. If the goal is to cap the commit body at 800 chars to guarantee headroom for Telegram’s 1024 caption limit, consider ensuring the final string length (including the suffix/newline) is <= MAX (or adjust the comment/constant to match the actual maximum output).
| if len(s) > MAX: | |
| s = s[:MAX].rstrip() + "\n…(truncated)" | |
| suffix = "\n…(truncated)" | |
| if len(s) > MAX: | |
| keep = MAX - len(suffix) | |
| if keep > 0: | |
| s = s[:keep].rstrip() + suffix | |
| else: | |
| s = suffix[:MAX] |
* feat(chat): force gallery refresh and add quick-send popup for new photos (NextAlone#95) Clicking the attachment button now forces a MediaStore refresh so newly-added photos and screenshots appear without waiting for the ContentObserver's 2s debounce. Attach-menu opens run the scan at NORM_PRIORITY (was MIN), parallel scans coalesce via an atomic in-flight flag, and a new quickRefreshLatestPhotos fast-path prepends the top N MediaStore rows into the cached album so new shots surface in the grid in ~100ms while the full rescan finishes. Adds a bottom-right floating popup in ChatActivity that surfaces the latest image taken while away and, on tap, opens the standard PhotoViewer preview/editor so the user can review, caption or cancel before sending. Detection runs only on onResume / first entry; gated on chatMode, preview/bubble/report/container state, secret chat, ChatObject.canSendPhoto and the images permission. The popup auto-dismisses after 10s; a persisted watermark (quickSendMediaLastDismissedId) is written the moment a photo is shown so send / preview-cancel / timeout / leaving the chat / cold restart all count as already seen and the same image never pops again. Ships with a toggle in the Nnngram Chat settings (quickSendMediaPopup, default on) and en / zh-CN / zh-TW strings. CI: strip backticks from COMMIT_MESSAGE before uploadCI.py so the triple-backtick fence in the Telegram template stops colliding with inline-code spans in the commit body and the release notification stops failing with "can't parse entities". * ci: truncate commit message before telegram upload (NextAlone#96) sendDocument caption limit is 1024 chars. After backtick-stripping, long commit bodies still bust the limit and uploadCI.py fails with 400 Bad Request. Do both the strip and an 800-char cap in one Python step so the release notification survives verbose commits. * feat(chat-menu): add compact icon bar w/ 3-state toggle Long context menu now supports per-option HIDE / TEXT / ICON modes via segmented control in chat settings. Icon mode renders options as a horizontal GridLayout (≤4 cols) at popup bottom. - store compact + hidden sets as CSV in SharedPreferences - migrate stale `compactBarPosition` int from earlier draft - Translate stays HIDE/TEXT only — compact would lose swipeback + lang detection wiring - Delete works in icon mode (TTL subtext lost; confirm dialog still fires) - order in dialog mirrors fillMessageMenu sequence --------- Co-authored-by: Next Alone <12210746+NextAlone@users.noreply.github.com>
sendDocument caption limit is 1024 chars. After backtick-stripping, long commit bodies still bust the limit and uploadCI.py fails with 400 Bad Request. Do both the strip and an 800-char cap in one Python step so the release notification survives verbose commits.
Tittle Here
Description
Issues Fixed or Closed by This PR
Check List