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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c6cdab9c7a77b05738f216055248fb49663ce358ab496612c37be3b065b329dc
4
- data.tar.gz: 2ff8e7866abc44e383509240659cb2403f1e1ce803b55d3cbbf6d28fc7fe394c
3
+ metadata.gz: 610d72aa6d017bd24db1f7b670ae377a9d6375c74195f21d2992a4249daadc91
4
+ data.tar.gz: 453de0f0a35ee225997a54292260e2b40dcf302b32242fe05f108ef3a702917c
5
5
  SHA512:
6
- metadata.gz: d2dc22ae8f6c88e3a7f3ab210f3211a884c65fc0ea688e10dd9da63377b8fe91b21bb419420e875634783844e0daa84c9c6e458d0344fba6de4d11f35c1eaba3
7
- data.tar.gz: 8dc40c7345f8a292e4370977c1233f46a77f7a551c0ebfd55db89fd30a769fd453023a5229bfaf9df43a47ae788202b5a0a9cab7bc62d52916604a6410b1b675
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
- threads = account.client.list_conversations
20
- return unless threads.success?
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
- def list_conversations(ig_user_id: @ig_user_id, limit: 50)
165
- collect("/#{require_ig_user_id(ig_user_id)}/conversations",
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
 
@@ -1,3 +1,3 @@
1
1
  module InstagramConnect
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: instagram_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kshitiz Sinha