Repository navigation
Commit 4d64b37
authored
fix(knowledge): store connector sync schedules at millisecond precision (#7966)
* fix(knowledge): store connector sync schedules at millisecond precision
The scheduler round-trips next_member_sync_at through a JavaScript Date and
claims the run by matching the value back exactly. Date carries milliseconds
while PostgreSQL stored microseconds, so a schedule written in SQL rather than
by the application became unmatchable the moment it landed on a fractional
millisecond: the connector stayed permanently due, every claim was refused, and
its members never synced.
Narrow both connector schedule columns to timestamp(3) so the two ends compare
the same value. The rewrite also rounds the stored values, so an already-wedged
row recovers on the next scheduler tick.
Also stop the claim diagnosis from asserting a queued run it cannot see — it now
reads the lock token and says so plainly when no condition explains the refusal,
which is what let this hide as ordinary contention.
* test(knowledge): pin the schedule rewrite's repair of already-stored rows
Scope the column-precision query to the test schema. It matched on table name
alone, so in CI — where the database already holds the migrated public table —
it saw four columns instead of two and failed. A local run passed because the
throwaway schema was the only place that table existed.
Write the sub-millisecond schedule before applying the migration rather than
after, so the test pins the rewrite rounding an already-wedged row, not just the
narrowed column refusing new ones. Without the migration it now fails on exactly
that claim.1 parent 89ecfc8 commit 4d64b37
9 files changed
Lines changed: 27927 additions & 27 deletions
File tree
- .github/workflows
- apps/sim/lib/knowledge/connectors
- packages/db
- migrations
- meta
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
101 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
102 | 105 | | |
103 | 106 | | |
104 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| 164 | + | |
164 | 165 | | |
165 | 166 | | |
166 | 167 | | |
| |||
181 | 182 | | |
182 | 183 | | |
183 | 184 | | |
184 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
185 | 193 | | |
186 | 194 | | |
187 | 195 | | |
| |||
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
0 commit comments