mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-21 02:32:18 +00:00
Cancel the Tarktee sibling on a body failure and settle review notes
Each Tarktee DATEX feed now reads its body as soon as its headers arrive, so a failed or oversized body aborts the other request at once instead of waiting for its headers up to the shared 30 s deadline. Status and redirect errors name the feed again. Ontario failures log the error class and system code, never the key-bearing URL or upstream text. DATA_SOURCES.md and the camera licence field use the Open Government Licence – Ontario statement the credit shows, and a test pins that credit. The focus-release rendering test now uses main's icon renderer and its isVideoFeedCamera contract. The Tarktee cancellation tests disable the 30 s deadline and time out after 2 s, so a regression fails fast instead of passing late or hanging; a duplicated older test and an unused import are gone. This PR's notes move into changelog.d/1266-cctv-shared-fix-batch.md: the 1133 fragment described main's tracking probe and terrain check, not this branch.
This commit is contained in:
1 parent
d7db1090fd
commit
bdd92663d6
9 files changed
+325
-197
No files matched your search
@@ -378,14 +378,22 @@ test('a pose with no perspective field of view is projected by the renderer', ()
|
||||
});
|
||||
|
||||
test('focus release restores video hue and alpha after the style throttle', () => {
|
||||
const viewer = {};
|
||||
const camera = fakeCameraPort({
|
||||
pose: { position: { x: 6378137 + 1000, y: 0, z: 0 } },
|
||||
});
|
||||
const { unbind } = bindFakeDraw(viewer, {
|
||||
camera: camera.port,
|
||||
query: { project: () => ({ x: 10, y: 20 }) },
|
||||
});
|
||||
let target = {};
|
||||
const records = ['mp4', 'webm'].map((feedType) => ({
|
||||
camera: { id: feedType, feedType },
|
||||
billboard: { show: true, color: LIVE_CAMERA_COLOR },
|
||||
position: { x: 6378137, y: 0, z: 0 },
|
||||
}));
|
||||
const state = {
|
||||
_enabled: true,
|
||||
_viewer: { scene: {}, camera: {} },
|
||||
_viewer: viewer,
|
||||
_records: records,
|
||||
_activeCameraId: null,
|
||||
_activeFocusStyleCount: 0,
|
||||
@@ -402,30 +410,43 @@ test('focus release restores video hue and alpha after the style throttle', () =
|
||||
}),
|
||||
focusAlphaNeedsWrite: (before, after) => before !== after,
|
||||
};
|
||||
const { refreshCctvFocusStyles } = createRendering({
|
||||
state,
|
||||
services: { focus },
|
||||
parts: { model: { isVideoFeedType } },
|
||||
source: {},
|
||||
});
|
||||
const { createCameraIcons, addCameraIcon, refreshCctvFocusStyles } =
|
||||
createRendering({
|
||||
state,
|
||||
services: { focus },
|
||||
parts: {
|
||||
model: {
|
||||
isVideoFeedCamera: (camera) => isVideoFeedType(camera.feedType),
|
||||
},
|
||||
},
|
||||
source: {},
|
||||
});
|
||||
try {
|
||||
createCameraIcons(viewer);
|
||||
for (const record of records) addCameraIcon(record);
|
||||
const icons = state._icons;
|
||||
|
||||
refreshCctvFocusStyles(1000);
|
||||
for (const record of records) {
|
||||
assertFadedFrom(
|
||||
record.billboard.color,
|
||||
LIVE_CAMERA_COLOR,
|
||||
record.camera.id,
|
||||
);
|
||||
refreshCctvFocusStyles(1000);
|
||||
for (const record of records) {
|
||||
assertKeepsColor(
|
||||
icons,
|
||||
record.camera.id,
|
||||
LIVE_CAMERA_COLOR,
|
||||
record.camera.id,
|
||||
);
|
||||
}
|
||||
target = null;
|
||||
refreshCctvFocusStyles(1050);
|
||||
for (const record of records) {
|
||||
assert.equal(icons.focus(record.camera.id), FOCUS_FACTOR, 'throttled');
|
||||
}
|
||||
refreshCctvFocusStyles(1100);
|
||||
for (const record of records) {
|
||||
assert.deepEqual(icons.item(record.camera.id).color, LIVE_CAMERA_COLOR);
|
||||
assert.equal(icons.focus(record.camera.id), 1);
|
||||
}
|
||||
assert.equal(state._activeFocusStyleCount, 0);
|
||||
} finally {
|
||||
unbind();
|
||||
}
|
||||
const dimmed = records.map((record) => record.billboard.color);
|
||||
target = null;
|
||||
refreshCctvFocusStyles(1050);
|
||||
for (let i = 0; i < records.length; i += 1) {
|
||||
assert.equal(records[i].billboard.color, dimmed[i]);
|
||||
}
|
||||
refreshCctvFocusStyles(1100);
|
||||
for (const record of records) {
|
||||
assert.deepEqual(record.billboard.color, LIVE_CAMERA_COLOR);
|
||||
}
|
||||
assert.equal(state._activeFocusStyleCount, 0);
|
||||
});
|
||||
Reference in new issue
Block a user