mirror of
https://github.com/BaaRai/ARTEX.git
synced 2026-11-13 11:40:53 +08:00
A Feishu digest sends every item as its own card element. The packing counted the text of each line only, not the element around it (about 52 bytes of JSON per item, plus whatever the encoding escapes) nor the rest of the body beyond a fixed 320-byte reserve. A digest of 500 short lines therefore left as a single request of 41846 bytes, while Feishu rejects a request body over 20 KB as a whole. feishuCard now adds whole items while the request body, measured as it is serialized, stays within feishuMaxCardBytes: each item element by its JSON encoding, the card around the items (header, intro, platform link) by encoding it for the number of items kept, and what Send adds around the card (msg_type, timestamp, sign) as feishuEnvelopeBytes, which the new test pins to the bytes on the wire. Unchanged: the first item of a digest is always kept and its text is truncated to the same budget, single pushes are built as before, and the other channels still pack with packItemCount.