Skip to content

Commit bb0c1f6

Browse files
committed
Fix as per comments
1 parent 7a9500c commit bb0c1f6

File tree

2 files changed

+28
-34
lines changed

2 files changed

+28
-34
lines changed

fern/docs/pages/references/snap-in-configuration.mdx

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
The DevRev snap-ins platform allows developers to define custom configuration pages for their snap-ins.
44

5-
## Why Customize Configuration Pages?
6-
75
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:
86

97
- 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
4442
- `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.
4543
- `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.
4644

47-
## Configuration Functions
45+
## Configuration functions
4846

4947
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:
5048

@@ -115,9 +113,7 @@ The configuration functions should return a valid snap-kit JSON that defines the
115113
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.
116114
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.
117115

118-
Certainly! Here's the updated documentation in Markdown format:
119-
120-
## Update Snap-in Inputs (BETA)
116+
## Update snap-in inputs (BETA)
121117

122118
Updates the inputs of a snap-in based on the inputs defined in the snap-in configuration.
123119

@@ -151,12 +147,12 @@ In the example above, the `part_picker` and `enum_list_picker` are the input nam
151147

152148
### Response
153149

154-
#### Success Response
150+
#### Success response
155151

156152
- Status Code: 200 OK
157153
- Content-Type: application/json
158154

159-
Response Body:
155+
Response body:
160156
```json
161157
{
162158
"data": {},
@@ -165,14 +161,14 @@ Response Body:
165161
}
166162
```
167163

168-
#### Error Response
164+
#### Error response
169165

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:
171167

172168
- Status Code: 4xx or 5xx
173169
- Content-Type: application/json
174170

175-
Response Body:
171+
Response body:
176172
```json
177173
{
178174
"data": {},

fern/docs/pages/retry-mechanism.mdx

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
1-
# Event Reliability in DevRev Snap-ins
1+
# Event reliability in DevRev snap-ins
22

33
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.
44

5-
## Retryable Errors
5+
## Getting started
66

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:
88

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
1019

1120
Developers can configure the retry behavior of their Snap-in functions using the Snap-in manifest. The following options are available:
1221

@@ -22,28 +31,28 @@ functions:
2231
- `max_retries`: The maximum number of retries before marking the event as failed.
2332
- `min_interval`: The minimum interval in seconds between each retry attempt. This interval may be adjusted based on the timeout of the corresponding function.
2433

25-
## Error Handling
34+
## Error handling
2635

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.
2837

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.
3039

31-
## Error Interface
40+
## Error interface
3241

3342
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.
3443

3544
```typescript
3645
class FunctionExecutionError extends Error {
3746
/**
3847
* 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.
4049
*/
4150
retry: boolean;
4251
4352
/**
4453
* Whether to retry the event payload with updated metadata
4554
* 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
4756
* keyrings/service account tokens or new inputs.
4857
*/
4958
refresh?: boolean;
@@ -56,7 +65,7 @@ class FunctionExecutionError extends Error {
5665
}
5766
```
5867

59-
## Example Usage
68+
## Example usage
6069

6170
Here's an example of how to use the `FunctionExecutionError` in your Snap-in code:
6271

@@ -95,15 +104,4 @@ export const run = async (events: any[]) => {
95104
export default run;
96105
```
97106

98-
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

Comments
 (0)