instagram_connect 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/app/jobs/instagram_connect/sync_conversations_job.rb +11 -2
- data/lib/instagram_connect/client.rb +7 -2
- data/lib/instagram_connect/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 610d72aa6d017bd24db1f7b670ae377a9d6375c74195f21d2992a4249daadc91
|
|
4
|
+
data.tar.gz: 453de0f0a35ee225997a54292260e2b40dcf302b32242fe05f108ef3a702917c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 833aa49017299e66d1b2b6470ed32299ade4863cd8fd3393aa2790231af47e98c1e33412c200f6e7f5eec319d842b6cf4d5a27951cdf137223731caaa5ae435e
|
|
7
|
+
data.tar.gz: 62bf43bce6b59381057c3e26b0b201f529cac269eaadaf5497a61f5217d60858f8b2d6c223912aa0703fec3d415c011ba8a8bf4ac6edfd60fdb5927da3fa055e
|
data/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,20 @@ All notable changes to this project are documented here. The format follows
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.3.3] - 2026-07-26
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- **Conversation sync imported nothing on the Facebook-Login path.** The conversations edge belongs
|
|
14
|
+
to the PAGE, not the Instagram user — `/{ig-user-id}/conversations` answers with a capability
|
|
15
|
+
error even when holding a valid Page token. The sync now targets the Page and falls back to the
|
|
16
|
+
Instagram user id only when there is no Page (the Instagram-Login path). Found in production,
|
|
17
|
+
where the job "succeeded" in 600ms twice while importing zero threads.
|
|
18
|
+
- **That failure was silent.** The job returned quietly when the listing call failed, so nothing —
|
|
19
|
+
logs, health, operator — ever learned why. It now logs the account, the node it asked, and Meta's
|
|
20
|
+
own error message.
|
|
21
|
+
|
|
22
|
+
|
|
9
23
|
## [0.3.2] - 2026-07-26
|
|
10
24
|
|
|
11
25
|
### Added
|
|
@@ -16,8 +16,17 @@ module InstagramConnect
|
|
|
16
16
|
account = Account.find_by(id: account_id)
|
|
17
17
|
return if account.nil? || !account.active?
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
# The conversations edge lives on the Page for Facebook-Login accounts and
|
|
20
|
+
# on the Instagram user for Instagram-Login ones.
|
|
21
|
+
node = account.page_id.presence || account.ig_user_id
|
|
22
|
+
threads = account.client.list_conversations(node_id: node)
|
|
23
|
+
unless threads.success?
|
|
24
|
+
# A sync that fails must say so. Swallowing this once cost a production
|
|
25
|
+
# afternoon: the job "succeeded" in 600ms and imported nothing.
|
|
26
|
+
logger.error("[instagram_connect] conversation sync failed for " \
|
|
27
|
+
"account=#{account.id} node=#{node}: #{threads.error_message}")
|
|
28
|
+
return
|
|
29
|
+
end
|
|
21
30
|
|
|
22
31
|
Array(threads.data["data"]).each { |thread| sync_thread(account, thread["id"]) }
|
|
23
32
|
end
|
|
@@ -161,8 +161,13 @@ module InstagramConnect
|
|
|
161
161
|
# NEW activity, so without this an inbox starts empty and stays empty until
|
|
162
162
|
# somebody happens to message in. Meta returns the 20 most recent messages
|
|
163
163
|
# per thread and no more — that is the whole history available to any app.
|
|
164
|
-
|
|
165
|
-
|
|
164
|
+
#
|
|
165
|
+
# node_id is the object that OWNS the conversations edge, and on the
|
|
166
|
+
# Facebook-Login path that is the PAGE, not the Instagram user — verified
|
|
167
|
+
# in production, where the Instagram user id answered with a capability
|
|
168
|
+
# error while holding a perfectly good Page token.
|
|
169
|
+
def list_conversations(node_id: @ig_user_id, limit: 50)
|
|
170
|
+
collect("/#{require_ig_user_id(node_id)}/conversations",
|
|
166
171
|
{ platform: "instagram", fields: "id,updated_time", limit: limit })
|
|
167
172
|
end
|
|
168
173
|
|