Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions scripts/remote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,7 @@ _remote_write_pulled_team() {
SELECT json_object('name','$(_agmsg_sqlesc "$team")',
'team_id','$(_agmsg_sqlesc "$team_id")',
'agents', json_object(),
'drivers', json_object('layout', 'per-team'),
'created_at','$(date -u +%Y-%m-%dT%H:%M:%SZ)');")
agmsg_write_atomic "$cfg" "$initial"
fi
Expand Down
11 changes: 11 additions & 0 deletions tests/test_remote.bats
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,17 @@ PULL_TEAM_ID=018f3f7e-2222-7000-8000-000000000002
[ -f "$cfg" ]
# Not minted here: the id is the one the server answered with.
[ "$(sqlite_mem "SELECT json_extract(readfile('$(rf "$cfg")'), '\$.team_id');")" = "$PULL_TEAM_ID" ]
[ "$(sqlite_mem "SELECT json_extract(readfile('$(rf "$cfg")'), '\$.drivers.layout');")" = "per-team" ]
[ -f "$TEST_SKILL_DIR/db/teams/cloned/messages.db" ]
# Pull arrives into an empty local team, so it can select the isolated layout
# before bootstrap. Imported remote rows must never leak into the shared
# store that local-only teams and external readers still use.
if sqlite3 "$TEST_SKILL_DIR/db/messages.db" \
"SELECT name FROM sqlite_master WHERE type='table' AND name='events';" |
grep -qx events; then
[ "$(sqlite3 "$TEST_SKILL_DIR/db/messages.db" \
"SELECT COUNT(*) FROM events WHERE team='cloned';")" -eq 0 ]
fi
}

@test "remote pull: starts a background sync engine that disconnect stops" {
Expand Down
Loading