Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(database): fix increment not defined #8377

Merged
merged 4 commits into from
Mar 4, 2025
Merged

fix(database): fix increment not defined #8377

merged 4 commits into from
Mar 4, 2025

Conversation

MichaelVerdon
Copy link
Collaborator

Description

closes #8375

Related issues

Release Summary

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
    • Other (macOS, web)
  • My change includes tests;
    • e2e tests added or updated in packages/\*\*/e2e
    • jest tests added or updated in packages/\*\*/__tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • No

Test Plan


Think react-native-firebase is great? Please consider supporting the project with any of the below:

Sorry, something went wrong.

Copy link

vercel bot commented Feb 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-firebase ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 4, 2025 2:14pm

@MichaelVerdon MichaelVerdon changed the title fix(database):fix increment not defined fix(database): fix increment not defined Feb 27, 2025
@@ -1,4 +1,5 @@
import { getApp } from '@react-native-firebase/app';
import { firebase } from '..'; // Needed for increment() method
Copy link
Collaborator

Choose a reason for hiding this comment

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

this brings more of the namespaced stuff into the new modular implementation...is it possible to import the ServerValue directly and use it directly (below)? There should be a way to import that ServerValue or we have bigger problems (which may also be the case: #8329 is currently a problem it appears - resolving both at once would be a big win

Copy link
Collaborator

Choose a reason for hiding this comment

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

@mikehardy
Adding

import DatabaseStatics from '../DatabaseStatics';

const { ServerValue } = DatabaseStatics;

seems to work. Is this what you had in mind?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@SelaseKay Yep, that's what I had in mind! Small difference in practice but it is thinking forward to the time when the non-modular index.js / index.d.ts files go away. This has it already more set up for the future

Copy link
Collaborator

Choose a reason for hiding this comment

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

@mikehardy Nice. I've added the necessary changes.

Copy link

Choose a reason for hiding this comment

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

I believe this tweak could the reason this PR doesn't seem to have fixed the issue for us - at least, it's the best theory I've got.

More info: #8375 (comment)

Copy link
Collaborator

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

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

LGTM thanks!

@mikehardy mikehardy merged commit e13598b into main Mar 4, 2025
16 of 18 checks passed
@mikehardy mikehardy deleted the increment_fix branch March 4, 2025 15:00
@SelaseKay
Copy link
Collaborator

@mikehardy I suppose it's safe to close #8329 as well.

@Nantris
Copy link

Nantris commented Mar 18, 2025

serverTimestamp isn't working for us even after this PR. We continue to face the error reported in #8375 (albeit with serverTimestamp)

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.

[🐛] Property 'firebase' doesn't exist 😱
4 participants