Commit bcef3e0
committed
refactor: refactor notification delivery for modularity and testability
- Refactor configuration checks for iOS, Android, and Huawei platforms into separate validation functions
- Modularize APNS client initialization and payload construction with new helper functions for certificate/key loading and notification attribute setup
- Break notification payload generation into smaller, composable functions for improved clarity and testability
- Split FCM notification construction and payload formatting into dedicated helper functions
- Separate Huawei notification building into specific helper functions for message targets, Android config, and notification content
- Add extensive unit tests for new helper functions and refactored logic across iOS, Android/FCM, and Huawei notification handling
- Implement filtering and counting utilities for notification targets in the queue server logic
- Enhance code readability, maintainability, and test coverage throughout the notification module
Signed-off-by: appleboy <[email protected]>1 parent 0cc4e5e commit bcef3e0
File tree
10 files changed
+1607
-478
lines changed- notify
- router
10 files changed
+1607
-478
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
204 | 204 | | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
216 | 211 | | |
217 | 212 | | |
| 213 | + | |
| 214 | + | |
218 | 215 | | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
226 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
227 | 227 | | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
232 | 241 | | |
233 | | - | |
234 | | - | |
235 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
236 | 246 | | |
237 | 247 | | |
238 | | - | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
239 | 255 | | |
240 | 256 | | |
241 | 257 | | |
| |||
0 commit comments