You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update docs. Changes were motivated by:
- Changes from @patricijabrecko:
#34 (for file
docs/attachments-extraction-guide.md)
- Update to `docs/data-extraction-rules-for-emitting-events.md` to
provide additional context for extraction function
- Update `docs/external-sync-units-extraction.mdx` to adjust for
discrepancy between docs and DevRev server
Issue: https://app.devrev.ai/devrev/works/ISS-210921
Copy file name to clipboardExpand all lines: docs/data-extraction-rules-for-emitting-events.md
+58-5Lines changed: 58 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,63 @@
4
4
5
5
Here are the rules when `EXTRACTION_DATA_START` or `EXTRACTION_DATA_CONTINUE` event is received by the snap-in:
6
6
7
-
-If there's a timeout ("onTimeout" method in "spawn" method), the snap-in should emit an event with type `EXTRACTION_DATA_PROGRESS` (no "data" payload).
8
-
- Note: Event `EXTRACTION_DATA_PROGRESS`**MUST NEVER** be emitted if the "task" method in The Worker Thread. The Only place where `EXTRACTION_DATA_PROGRESS` can be emitted is in the "onTimeout" method in The Worker Thread.
7
+
-The `EXTRACTION_DATA_PROGRESS` event *MUST* only be emitted from within the "onTimeout" handler of "processTask" method.
8
+
- The `EXTRACTION_DATA_PROGRESS`event *MUST NEVER* be emitted from within the "task" handler of "processTask" method.
9
9
- If the extraction is successful and all the resources have been extracted, the snap-in should emit an event with type `EXTRACTION_DATA_DONE` (no "data" payload).
10
10
- In case of unexpected error, the snap-in should emit an event with type `EXTRACTION_DATA_ERROR` ("data" payload should contain attribute "error" - error message as a string).
11
-
- In case of rate limiting (status code 429) for "data extraction", the snap-in *must* emit an event with type `EXTRACTION_DATA_DELAY`. If emitting event of type `EXTRACTION_DATA_DELAY`, you *must* also provide a "delay" attribute, specifying the delay in seconds as an integer.
11
+
- In case of rate limiting (status code 429) for "data extraction", the snap-in _must_ emit an event with type `EXTRACTION_DATA_DELAY`. If emitting event of type `EXTRACTION_DATA_DELAY`, you _must_ also provide a "delay" attribute, specifying the delay in seconds as an integer.
- If rate limiting is encountered at ANY point during data extraction (including nexted API calls) the snap-in _must_ emit an event with type `EXTRACTION_DATA_DELAY`.
14
+
- The delay attribute should be extracted from the API response.
15
+
- Rate limiting should be checked immediately after each API call, before proceeding with further processing.
16
+
- If rate limiting is encountered at ANY point during data extraction (including nested API calls within Promise.all, async operations, or iterations over an array) the snap-in _must_ emit an event with type `EXTRACTION_DATA_DELAY` and IMMEDIATELY RETURN from the task function.
17
+
- Rate limiting MUST be checked immediately after EACH AND EVERY API call, before proceeding with any further processing.
18
+
- For asynchronous operations (e.g., Promise.all), rate limiting must be checked within each async function and propagated appropriately.
0 commit comments