Skip to content

fix(messages): always return array items and string next_from from getHistoryAttachments - #1797

Open
zavolo wants to merge 4 commits into
OpenVK:imfrom
zavolo:fix/im-gethistoryattachments
Open

zavolo wants to merge 4 commits into
OpenVK:imfrom
zavolo:fix/im-gethistoryattachments

Conversation

@zavolo

@zavolo zavolo commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #1796.

The shared-attachments screen (opened from a chat user's profile in the VK Messenger client) issues many messages.getHistoryAttachments calls. When the broker returned a null items list, the client failed every request ("не удалось выполнить запрос").

Coerce items to an array and next_from to a string on the success path, matching the defaults already used on the error path.

Verified live against the VK Messenger client — the shared media/attachments screen now loads.

@crythoughts

Copy link
Copy Markdown
Collaborator

братан а вот это обязательно или не
image

@ZAZiOs

ZAZiOs commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

братан а вот это обязательно или не
image

Это выглядит как то что сломает в итоге совместимостью с официальными клиентами, ведь в документации там инт насколько помню

@zavolo

zavolo commented Sep 20, 2026

Copy link
Copy Markdown
Contributor Author

братан а вот это обязательно или не image

братан а вот это обязательно или не image

Пофиксил, терь должно быть правильно

@zavolo
zavolo force-pushed the fix/im-gethistoryattachments branch 2 times, most recently from 34cf02a to 3569555 Compare September 20, 2026 15:21
@crythoughts

Copy link
Copy Markdown
Collaborator

int $report_id = 0 убери короче это abandoned и лучше не упоминать

@zavolo

zavolo commented Sep 20, 2026

Copy link
Copy Markdown
Contributor Author

int $report_id = 0 убери короче это abandoned и лучше не упоминать

а, ок ща

@zavolo

zavolo commented Sep 20, 2026

Copy link
Copy Markdown
Contributor Author

int $report_id = 0 убери короче это abandoned и лучше не упоминать

так всё правильно?

…tHistoryAttachments

The shared-attachments screen (opened from a chat user profile) issues many
getHistoryAttachments calls; when the broker returned a null items list the
client failed every request. Coerce items to an array and next_from to a string
on the success path, matching the error-path defaults.
…rsion

Booleans are required by modern clients (the VK Messenger parses them with
getBoolean) but break strictly-typed older clients that decode them as integers
(e.g. OpenVK iOS VKUserProfile.isClosed: Int?). Emit booleans only for API
version >= 5.200 and keep integers for older versions.
@zavolo
zavolo force-pushed the fix/im-gethistoryattachments branch from 3569555 to 8fe50ea Compare September 20, 2026 15:38
@crythoughts

Copy link
Copy Markdown
Collaborator

да. Ну я мержать не буду до завтра может ещё чего захочешь добавить

@zavolo

zavolo commented Sep 20, 2026

Copy link
Copy Markdown
Contributor Author

да. Ну я мержать не буду до завтра может ещё чего захочешь добавить

я ещё пару фиксов мб сделаю седня и всё

… getInfo

The client stores account.getInfo link_redirects into AccountInfo.linkRedirectsJson
and eagerly parses it with new JSONObject(...) at startup; a null value threw and
was reported as a caught non-fatal on every launch. Return "{}" so the parse
succeeds.
…r HTTPS

Build the subscription base_url as https://<host>/queue (stripping any api.
prefix) so the client long-polls the broker queue keep-alive endpoint instead of
the messages /nim endpoint, keeping the queue connection alive.
@zavolo
zavolo force-pushed the fix/im-gethistoryattachments branch from 94e648e to fbcedb1 Compare September 20, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants