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
Copy file name to clipboardExpand all lines: fern/docs/pages/references/snap-in-configuration.mdx
+7-11Lines changed: 7 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,6 @@
2
2
3
3
The DevRev snap-ins platform allows developers to define custom configuration pages for their snap-ins.
4
4
5
-
## Why Customize Configuration Pages?
6
-
7
5
While the default configuration page automatically renders input fields for keyrings and inputs, there may be cases where a custom configuration page is more suitable:
8
6
9
7
- Improved user experience: Developers can design the configuration page to provide a more intuitive and streamlined experience for users setting up the snap-in.
@@ -44,7 +42,7 @@ The `configuration_handler` section in the manifest connects the functions respo
44
42
- `org_snap_in_configuration_handler`: This function processes the organization configuration options. It is triggered when actions are performed on the organization configuration snap-kit.
45
43
- `user_snap_in_configuration_handler`: This function processes the user configuration options. It is triggered when actions are performed on the user configuration snap-kit.
46
44
47
-
## Configuration Functions
45
+
## Configuration functions
48
46
49
47
The configuration functions should return a valid snap-kit JSON that defines the layout and elements of the custom configuration page. Here's an example of a snap-kit JSON:
50
48
@@ -115,9 +113,7 @@ The configuration functions should return a valid snap-kit JSON that defines the
115
113
In this example, the snap-kit renders a dropdown select for choosing between "Ticket" and "Conversation," along with a "Next" button. When the "Next" button is clicked, the `user_snap_in_configuration_handler` function is invoked to process the user's selection.
116
114
In the snap-kit action handler, the `event.payload.action.id` can be used to determine the form being submitted and call the `snap-ins.update` API to update the configuration.
117
115
118
-
Certainly! Here's the updated documentation in Markdown format:
119
-
120
-
## Update Snap-in Inputs (BETA)
116
+
## Update snap-in inputs (BETA)
121
117
122
118
Updates the inputs of a snap-in based on the inputs defined in the snap-in configuration.
123
119
@@ -151,12 +147,12 @@ In the example above, the `part_picker` and `enum_list_picker` are the input nam
151
147
152
148
### Response
153
149
154
-
#### Success Response
150
+
#### Success response
155
151
156
152
- Status Code: 200 OK
157
153
- Content-Type: application/json
158
154
159
-
Response Body:
155
+
Response body:
160
156
```json
161
157
{
162
158
"data": {},
@@ -165,14 +161,14 @@ Response Body:
165
161
}
166
162
```
167
163
168
-
#### Error Response
164
+
#### Error response
169
165
170
-
If an error occurs while updating the snap-in, the response will have the following format:
166
+
If an error occurs while updating the snap-in, the response has the following format:
Copy file name to clipboardExpand all lines: fern/docs/pages/retry-mechanism.mdx
+21-23Lines changed: 21 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,21 @@
1
-
# Event Reliability in DevRev Snap-ins
1
+
# Event reliability in DevRev snap-ins
2
2
3
3
The DevRev snap-ins platform offers event reliability features to ensure smooth and resilient event processing. This document provides an overview of these features and how developers can leverage them to build reliable snap-ins.
4
4
5
-
## Retryable Errors
5
+
## Getting started
6
6
7
-
Snap-ins can now define retryable errors using the `FunctionExecutionError` interface provided by the DevRev SDK. This allows the platform to automatically retry events that encounter intermittent or transient errors, improving overall reliability.
7
+
To start using the event reliability features in your Snap-ins, follow these steps:
8
8
9
-
## Retry Configuration
9
+
1. Update your DevRev SDK to the latest version.
10
+
2. Define retryable errors using the `FunctionExecutionError` interface in your Snap-in code.
11
+
3. Configure the retry behavior in your Snap-in manifest.
12
+
4. Handle errors appropriately in your Snap-in function.
13
+
14
+
## Retryable errors
15
+
16
+
Snap-ins can define retryable errors using the `FunctionExecutionError` interface provided by the DevRev SDK. This enables the platform to automatically retry events that encounter intermittent or transient errors, improving overall reliability.
17
+
18
+
## Retry configuration
10
19
11
20
Developers can configure the retry behavior of their Snap-in functions using the Snap-in manifest. The following options are available:
12
21
@@ -22,28 +31,28 @@ functions:
22
31
- `max_retries`: The maximum number of retries before marking the event as failed.
23
32
- `min_interval`: The minimum interval in seconds between each retry attempt. This interval may be adjusted based on the timeout of the corresponding function.
24
33
25
-
## Error Handling
34
+
## Error handling
26
35
27
-
The DevRev snap-ins platform handles errors based on the ordering guarantees of the snap-in function.
36
+
The DevRev snap-in platform handles errors based on the ordering guarantees of the snap-in function.
28
37
29
-
For Snap-in functions with relaxed ordering, non-retryable errors will be marked as failed, and the error will be propagated to the DevRev platform for tracking. Retryable errors will be automatically retried based on the specified retry configuration. If the maximum number of retries is exhausted, the event will be moved to a dead-letter queue (DLQ) for further handling.
38
+
For snap-in functions with relaxed ordering, non-retryable errors are marked as failed, and the errored event is propagated to the DevRev platform for tracking. Retryable errors are automatically retried based on the specified retry configuration. If the maximum number of retries is exhausted, the errored events are moved to a dead-letter queue (DLQ) for further handling.
30
39
31
-
## Error Interface
40
+
## Error interface
32
41
33
42
The DevRev SDK defines the `FunctionExecutionError` type to represent errors returned from the snap-in's run function. Developers can use this type to provide additional error details and indicate whether an error is retryable.
34
43
35
44
```typescript
36
45
class FunctionExecutionError extends Error {
37
46
/**
38
47
* Toggle to determine if the event should be retried or not. If not set or set to false,
39
-
* the event will not be retried.
48
+
* the event is not retried.
40
49
*/
41
50
retry: boolean;
42
51
43
52
/**
44
53
* Whether to retry the event payload with updated metadata
45
54
* that platform provides. Useful when the event payload is
46
-
* not in a state to be directly processed, and may need new
55
+
* not in a state to be directly processed, and may need new
47
56
* keyrings/service account tokens or new inputs.
48
57
*/
49
58
refresh?: boolean;
@@ -56,7 +65,7 @@ class FunctionExecutionError extends Error {
56
65
}
57
66
```
58
67
59
-
## Example Usage
68
+
## Example usage
60
69
61
70
Here's an example of how to use the `FunctionExecutionError` in your Snap-in code:
In this example, the Snap-in function's `run` method processes the events and can throw a `FunctionExecutionError` to indicate whether the error is retryable or not. The Snap-in platform will handle the error based on the `retry` and `refresh` properties set in the error object.
99
-
100
-
## Getting Started
101
-
102
-
To start using the event reliability features in your Snap-ins, follow these steps:
103
-
104
-
1. Update your DevRev SDK to the latest version.
105
-
2. Define retryable errors using the `FunctionExecutionError` interface in your Snap-in code.
106
-
3. Configure the retry behavior in your Snap-in manifest.
107
-
4. Handle errors appropriately in your Snap-in function.
108
-
109
-
With these updates, your Snap-ins can leverage the enhanced event reliability features provided by the DevRev Snap-ins platform.
107
+
In this example, the Snap-in function's `run` method processes the events and can throw a `FunctionExecutionError` to indicate whether the error is retryable or not. The Snap-in platform handles the error based on the `retry` and `refresh` properties set in the error object.
0 commit comments