instagram_connect 0.3.5 → 0.3.6

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: d196a916e3801d14b1247878e731491aedc6adcdae7a50b58751d548be182c47
4
- data.tar.gz: aa43252a57668076b9c8aa72e9ccc605110157ff8437a16d1129482deb091a4f
3
+ metadata.gz: a8f007049f1317825ec16b8574067644b890352e47f04f987b779a9b893584a5
4
+ data.tar.gz: 714e3b145ab61b7e9e469890efe362630ddd269afae1f156050b6171ce748524
5
5
  SHA512:
6
- metadata.gz: 995e9d1bbd96a6aa57616b8b9cec8558fe02ef75623d28ac2707ec1bcd3e852d32fa69548a4dcb7cfdbcc2c35154b881d2d27426cb5e1536decec38860b1dc8a
7
- data.tar.gz: 917737599c1ab1ef4eafe5cfc210e23d66c10f230dda1e882664fc76732c5321d8a2ee54bb3e0b2084f020d4dc085ea357d186a57f022f67490d50970113bf0d
6
+ metadata.gz: 24d080252c2155439ee8515953a2037c071001933d0f1ff6083c66a40b7f5b7504b642df340521196f4e9c40cbb18ebaed0a89a3215abb87ed87afe06cc5ad3f
7
+ data.tar.gz: fc1e3e4ee479b7c6813e4e5a6bf3e567ae9b49360c8f57e5896d59e7f1528061945d7d7e5a3112420323b12d5270e272d902eb85fa234c30e9ecc1523a590e77
data/CHANGELOG.md CHANGED
@@ -6,6 +6,17 @@ All notable changes to this project are documented here. The format follows
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.3.6] - 2026-07-26
10
+
11
+ ### Fixed
12
+
13
+ - **Conversation sync refused on Pages with deep Messenger history.** Meta prices the conversations
14
+ edge per row and answered even a 20-thread page with "Please reduce the amount of data you're
15
+ asking for" — verified live. The listing now asks for 10 at a time, drops the `updated_time`
16
+ field nothing ever read, and on that specific refusal retries once at the smallest useful page
17
+ before reporting Meta's own words.
18
+
19
+
9
20
  ## [0.3.5] - 2026-07-26
10
21
 
11
22
  ### Fixed
@@ -166,13 +166,20 @@ module InstagramConnect
166
166
  # Facebook-Login path that is the PAGE, not the Instagram user — verified
167
167
  # in production, where the Instagram user id answered with a capability
168
168
  # error while holding a perfectly good Page token.
169
- # limit defaults low deliberately. Meta rejected 50 outright on a live
170
- # account with "Please reduce the amount of data you're asking for" — the
171
- # conversations edge is expensive per row, and the cursor walk means a
172
- # smaller page costs nothing but an extra round trip.
173
- def list_conversations(node_id: @ig_user_id, limit: 20)
174
- collect("/#{require_ig_user_id(node_id)}/conversations",
175
- { platform: "instagram", fields: "id,updated_time", limit: limit })
169
+ # limit defaults LOW deliberately, and shrinks further on refusal. Meta
170
+ # rejected 50 outright on a live account with "Please reduce the amount of
171
+ # data you're asking for" then rejected 20 as well on a Page with a deep
172
+ # Messenger history. The edge is priced per row, the cursor walk means a
173
+ # small page costs nothing but round trips, and updated_time is gone
174
+ # because nothing ever read it.
175
+ def list_conversations(node_id: @ig_user_id, limit: 10)
176
+ path = "/#{require_ig_user_id(node_id)}/conversations"
177
+ result = collect(path, { platform: "instagram", fields: "id", limit: limit })
178
+ return result if result.success? || !reduce_data_error?(result)
179
+
180
+ # One retry at the smallest useful page. If Meta refuses even this, the
181
+ # caller's error handling reports Meta's own words as usual.
182
+ collect(path, { platform: "instagram", fields: "id", limit: 2 })
176
183
  end
177
184
 
178
185
  def conversation_messages(conversation_id:, limit: 20)
@@ -279,6 +286,13 @@ module InstagramConnect
279
286
  multipart: true, timeout: TIMEOUT))
280
287
  end
281
288
 
289
+ # Meta's "please reduce the amount of data" comes back as error code 1
290
+ # (GraphMethodException varies), so match the message — it is the one
291
+ # documented, stable part of the refusal.
292
+ def reduce_data_error?(result)
293
+ result.error_message.to_s.include?("reduce the amount of data")
294
+ end
295
+
282
296
  def url(path)
283
297
  "#{strategy.graph_host}/#{config.graph_version}#{path}"
284
298
  end
@@ -1,3 +1,3 @@
1
1
  module InstagramConnect
2
- VERSION = "0.3.5"
2
+ VERSION = "0.3.6"
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.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kshitiz Sinha