Page MenuHomePhabricator

handle null cases for Scope
Closed, ResolvedPublic

Description

What/Why:
While debugging the ZWrapper class on large zobjects, there were spotted some cases when both the scope property of the current instance and parent were undefined || null; ATM I'm guessing whenever at the top of the chain. We need to gracefully handle this edge case.

Ultimately, my aim is to figure out why the the size_ doesn't increment properly.

How:

  • use optional chaining...

Details

Related Changes in Gerrit:
Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
handle null when Scope top of chainrepos/abstract-wiki/wikifunctions/function-orchestrator!305ecarggrace/T388298/scope-null-handlingmain
Customize query in GitLab

Event Timeline

ecarg changed the task status from Open to In Progress.
ecarg triaged this task as Medium priority.
ecarg moved this task from To Triage to 25Q3 (Jan–Mar) on the Abstract Wikipedia team board.
ecarg updated the task description. (Show Details)

Should we be worried about circular references?
I.e.

root = { scope_: undefined };
child = { scope_: undefined, parent_: root };
root.parent_ = child;

is there a base case? if not, this stack would crash?

Change #1126996 had a related patch set uploaded (by Jforrester; author: Jforrester):

[operations/deployment-charts@master] wikifunctions: Update orchestrator from 2025-03-05-140247 to 2025-03-11-234105

https://gerrit.wikimedia.org/r/1126996

Change #1126996 merged by jenkins-bot:

[operations/deployment-charts@master] wikifunctions: Update orchestrator from 2025-03-05-140247 to 2025-03-11-234105

https://gerrit.wikimedia.org/r/1126996