( webhookId: string, timestamp: string, newGuids: string[], config: RssWebhookConfig, logger: Logger, etag?: string, lastModified?: string )
| 159 | } |
| 160 | |
| 161 | async function updateRssState( |
| 162 | webhookId: string, |
| 163 | timestamp: string, |
| 164 | newGuids: string[], |
| 165 | config: RssWebhookConfig, |
| 166 | logger: Logger, |
| 167 | etag?: string, |
| 168 | lastModified?: string |
| 169 | ) { |
| 170 | const existingGuids = config.lastSeenGuids || [] |
| 171 | const allGuids = [...newGuids, ...existingGuids].slice(0, MAX_GUIDS_TO_TRACK) |
| 172 | |
| 173 | await updateWebhookProviderConfig( |
| 174 | webhookId, |
| 175 | { |
| 176 | lastCheckedTimestamp: timestamp, |
| 177 | lastSeenGuids: allGuids, |
| 178 | ...(etag !== undefined ? { etag } : {}), |
| 179 | ...(lastModified !== undefined ? { lastModified } : {}), |
| 180 | }, |
| 181 | logger |
| 182 | ) |
| 183 | } |
| 184 | |
| 185 | async function fetchNewRssItems( |
| 186 | config: RssWebhookConfig, |
no test coverage detected