Skip to content

missing basic safety checks on server data #7

@IftachSadeh

Description

@IftachSadeh

In various places, such as it is assumed that data from the server has content (eg has observing blocks in the queue waiting).
For instance:

function createBlockMapping() {
let scheds = []
let inter = get_sched_blocksData()
for (let key in inter) {
inter[key].id = key
scheds.push(inter[key])
}
reserved.g.attr('opacity', 0.05)
let height = headerSize * 2.5
let square = parseInt(Math.sqrt(scheds.length))

(get_sched_blocksData() gives shared.data.server.blocks)
Or:
let ce = shared.data.server.external_clock_events[0]

where it is assumed that there is len()>0 of the external events.

This is not always the case, as e.g., the queue can be completely empty during daytime.

Safety checks must be added everywhere that data from the server is ingested, to cover all cases of missing / empty data, or of data which is incompatible with the expected format (including proper warning messages in case of unexpected format).

This is a general issue for several other js widgets as well.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions