mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-28 03:00:29 -04:00
fix(polling): fix Drive pre-check never activating in Sheets poller
isDriveFileUnchanged short-circuited when lastModifiedTime was undefined, never calling the Drive API — so currentModifiedTime was never populated, creating a permanent chicken-and-egg loop. Now always calls the Drive API and returns the modifiedTime regardless of whether there's a previous value to compare against. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -226,13 +226,13 @@ async function isDriveFileUnchanged(
|
||||
requestId: string,
|
||||
logger: ReturnType<typeof import('@sim/logger').createLogger>
|
||||
): Promise<{ unchanged: boolean; currentModifiedTime?: string }> {
|
||||
if (!lastModifiedTime) return { unchanged: false }
|
||||
|
||||
try {
|
||||
const currentModifiedTime = await getDriveFileModifiedTime(accessToken, spreadsheetId, logger)
|
||||
if (!lastModifiedTime || !currentModifiedTime) {
|
||||
return { unchanged: false, currentModifiedTime }
|
||||
}
|
||||
return { unchanged: currentModifiedTime === lastModifiedTime, currentModifiedTime }
|
||||
} catch (error) {
|
||||
// If Drive check fails, proceed with Sheets API (don't skip)
|
||||
logger.warn(`[${requestId}] Drive modifiedTime check failed, proceeding with Sheets API`)
|
||||
return { unchanged: false }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user