Skip to content
This repository was archived by the owner on Mar 4, 2026. It is now read-only.

fix: Remove incorrect,unreachable and unused code#1983

Merged
milaGGL merged 4 commits intogoogleapis:mainfrom
abhishekwebcode:patch-2
Jan 22, 2024
Merged

fix: Remove incorrect,unreachable and unused code#1983
milaGGL merged 4 commits intogoogleapis:mainfrom
abhishekwebcode:patch-2

Conversation

@abhishekwebcode
Copy link
Copy Markdown
Contributor

@abhishekwebcode abhishekwebcode commented Jan 19, 2024

The code I have removed is not used since the main Firestore class method has its own toJSON override, the spelling of toJSON method anyways is incorrect here, This will make the code cleaner.
This line instead takes care of the removed code now and is working in the latest version
https://github.com/googleapis/nodejs-firestore/blob/main/dev/src/index.ts#L1451

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

For Issue #1984

This PR was reverted in favor of correcting the redaction code for Firestore settings. It's still possible to serialize the settings on a Firestore instance, and it's also possible that the serialization of Firestore settings will be updated in the future to include the settings. The intent of this PR was good, but we're being cautious to handle the less common use case.
BEGIN_COMMIT_OVERRIDE
chore: This change was reverted before it was release in #1989.
END_COMMIT_OVERRIDE

The toJSON function spelling name is incorrect therefore this method is not triggered when using JSON.stringify on firestore objects
@abhishekwebcode abhishekwebcode requested review from a team January 19, 2024 05:27
@product-auto-label product-auto-label Bot added the size: xs Pull request size is extra small. label Jan 19, 2024
@conventional-commit-lint-gcf
Copy link
Copy Markdown

conventional-commit-lint-gcf Bot commented Jan 19, 2024

🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!

-- conventional-commit-lint bot
https://conventionalcommits.org/

@product-auto-label product-auto-label Bot added the api: firestore Issues related to the googleapis/nodejs-firestore API. label Jan 19, 2024
@ehsannas ehsannas requested a review from milaGGL January 19, 2024 05:46
@milaGGL milaGGL added kokoro:force-run Add this label to force Kokoro to re-run the tests. owlbot:run Add this label to trigger the Owlbot post processor. labels Jan 19, 2024
@gcf-owl-bot gcf-owl-bot Bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jan 19, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 19, 2024
@milaGGL milaGGL added kokoro:force-run Add this label to force Kokoro to re-run the tests. and removed kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Jan 19, 2024
@abhishekwebcode abhishekwebcode changed the title fix: Block exposing private keys fix: Remove unused code that was intended to block exposing private keys Jan 22, 2024
This code is never invoked, the spelling of toJSON is also wrong (  it is toJson here) 
Also the Firestore Class toJSON method works well now for protecting the private keys of firestore instance
@abhishekwebcode abhishekwebcode changed the title fix: Remove unused code that was intended to block exposing private keys fix: Remove incorrect and unreachable code Jan 22, 2024
@abhishekwebcode abhishekwebcode changed the title fix: Remove incorrect and unreachable code fix: Remove incorrect,unreachable and unused code Jan 22, 2024
@abhishekwebcode abhishekwebcode changed the title fix: Remove incorrect,unreachable and unused code fix: Remove incorrect,unreachable and unused code Jan 22, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 22, 2024
@milaGGL milaGGL added the owlbot:run Add this label to trigger the Owlbot post processor. label Jan 22, 2024
@gcf-owl-bot gcf-owl-bot Bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jan 22, 2024
@milaGGL milaGGL added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 22, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 22, 2024
@milaGGL milaGGL added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 22, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jan 22, 2024
@milaGGL milaGGL added kokoro:run Add this label to force Kokoro to re-run the tests. owlbot:run Add this label to trigger the Owlbot post processor. labels Jan 22, 2024
@gcf-owl-bot gcf-owl-bot Bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jan 22, 2024
Copy link
Copy Markdown
Contributor

@milaGGL milaGGL left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you for your contribution.

@milaGGL milaGGL merged commit 133f4da into googleapis:main Jan 22, 2024
MarkDuckworth added a commit that referenced this pull request Jan 23, 2024
MarkDuckworth added a commit that referenced this pull request Jan 25, 2024
* Revert "fix: Remove incorrect,unreachable and unused code (#1983)"

This reverts commit 133f4da.

* fix: Fix redaction of credentials in Firestore settings.
@MarkDuckworth MarkDuckworth added the release-please:force-run To run release-please label Jan 25, 2024
@release-please release-please Bot removed the release-please:force-run To run release-please label Jan 25, 2024
@MarkDuckworth MarkDuckworth added the release-please:force-run To run release-please label Jan 31, 2024
@release-please release-please Bot removed the release-please:force-run To run release-please label Jan 31, 2024
@MarkDuckworth MarkDuckworth added the release-please:force-run To run release-please label Jan 31, 2024
@release-please release-please Bot removed the release-please:force-run To run release-please label Jan 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: firestore Issues related to the googleapis/nodejs-firestore API. kokoro:run Add this label to force Kokoro to re-run the tests. size: xs Pull request size is extra small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants