Skip to content

Conversation

rhodgkins
Copy link
Contributor

@rhodgkins rhodgkins commented Jan 13, 2025

Description

Fixes firebase/firebase-functions-test#254

Fix is similar to the check in #exists():

if (typeof val === "undefined" || val === null) {

@inlined
Copy link
Member

inlined commented Jan 22, 2025

@taeold IIUC this is a straight bugfix, but I wanted to double check that you don't consider this a breaking change.

@inlined inlined requested a review from taeold January 22, 2025 01:05
@taeold
Copy link
Contributor

taeold commented Jan 24, 2025

Feels like this is a good change and not breaking.

IIUC the change would only break if the traversing the full path instead of short-circuiting somehow had a side effect that was worthy.

@rhodgkins
Copy link
Contributor Author

@taeold any ideas on the timeline when this might be merged / released?

@rhodgkins rhodgkins force-pushed the master branch 2 times, most recently from 4a917c5 to 29ff57d Compare February 5, 2025 12:41
@rhodgkins
Copy link
Contributor Author

Sorry I missed that there were tests in the project for this! I've added some tests for the issue to make it clearer.
I've also update the fix as adding tests exposed another issue when this._data is directly null (and not as a result of a child being missing or null).

if (parts.length) {
for (const part of parts) {
if (source[part] === undefined) {
if (typeof source === "undefined" || source === null) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As well as moving this "up" to the parent object I've also changed the check from === undefined to a typeof so it matches the other checks elsewhere:

if (typeof val === "undefined" || val === null) {

if (node === null || typeof node === "undefined") {

@rhodgkins
Copy link
Contributor Author

Anyone any update on this please?

@taeold taeold enabled auto-merge October 8, 2025 20:02
@taeold
Copy link
Contributor

taeold commented Oct 8, 2025

Thank you for your contribution again @rhodgkins

@taeold taeold added this pull request to the merge queue Oct 8, 2025
Merged via the queue into firebase:master with commit 9f2c63a Oct 8, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants