Commit c2006df
authored
V0.4 fix 2 (#210)
* formatting code
* Remove uninstalled packages
* fix(imap): Improve IMAP connection stability and error handling
This commit refactors the IMAP connector to enhance connection management, error handling, and overall stability during email ingestion.
The `isConnected` flag has been removed in favor of relying directly on the `client.usable` property from the `imapflow` library. This simplifies the connection logic and avoids state synchronization issues.
The `connect` method now re-creates the client instance if it's not usable, ensuring a fresh connection after errors or disconnects. The retry mechanism (`withRetry`) has been updated to no longer manually reset the connection state, as the `connect` method now handles this automatically on the next attempt.
Additionally, a minor bug in the `sync-cycle-finished` processor has been fixed. The logic for merging sync states from successful jobs has been simplified and correctly typed, preventing potential runtime errors when no successful jobs are present.
---------
Co-authored-by: Wayne <[email protected]>1 parent 399059a commit c2006df
File tree
4 files changed
+30
-56
lines changed- packages/backend/src
- jobs/processors
- services/ingestion-connectors
4 files changed
+30
-56
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
Lines changed: 3 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
56 | 55 | | |
57 | 56 | | |
58 | 57 | | |
| |||
Lines changed: 10 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
| |||
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
44 | | - | |
45 | 43 | | |
46 | 44 | | |
47 | 45 | | |
| |||
51 | 49 | | |
52 | 50 | | |
53 | 51 | | |
54 | | - | |
| 52 | + | |
| 53 | + | |
55 | 54 | | |
56 | 55 | | |
57 | 56 | | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
| 57 | + | |
| 58 | + | |
62 | 59 | | |
63 | 60 | | |
64 | 61 | | |
65 | | - | |
66 | 62 | | |
67 | | - | |
68 | 63 | | |
69 | 64 | | |
70 | 65 | | |
| |||
77 | 72 | | |
78 | 73 | | |
79 | 74 | | |
80 | | - | |
| 75 | + | |
81 | 76 | | |
82 | | - | |
83 | 77 | | |
84 | 78 | | |
85 | 79 | | |
| |||
130 | 124 | | |
131 | 125 | | |
132 | 126 | | |
133 | | - | |
134 | | - | |
| 127 | + | |
135 | 128 | | |
136 | 129 | | |
137 | 130 | | |
| |||
156 | 149 | | |
157 | 150 | | |
158 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
159 | 156 | | |
160 | 157 | | |
161 | 158 | | |
| |||
Lines changed: 16 additions & 39 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
| 101 | + | |
138 | 102 | | |
139 | | - | |
| 103 | + | |
| 104 | + | |
140 | 105 | | |
141 | 106 | | |
142 | 107 | | |
143 | | - | |
| 108 | + | |
144 | 109 | | |
145 | 110 | | |
146 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
147 | 124 | | |
148 | 125 | | |
149 | 126 | | |
| |||
0 commit comments