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: GcpFirestoreEmulatorAutoConfiguration constructs invalid document parent #2348

Merged
merged 5 commits into from
Nov 14, 2023

Conversation

meltsufin
Copy link
Member

Fixes: #2290.
Fixes: #2330.

@@ -79,7 +79,8 @@ public FirestoreOptions firestoreOptions() {
private Credentials emulatorCredentials() {
final Map<String, List<String>> headerMap = new HashMap<>();
headerMap.put("Authorization", Collections.singletonList("Bearer owner"));
headerMap.put("google-cloud-resource-prefix", Collections.singletonList(rootPath));
headerMap.put("google-cloud-resource-prefix", Collections.singletonList(
rootPath.substring(0, rootPath.indexOf("/documents"))));
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible for the database ID to be documents?

What about lastIndexOf instead?

@meltsufin meltsufin enabled auto-merge (squash) November 14, 2023 16:18
Copy link

sonarcloud bot commented Nov 14, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@meltsufin meltsufin merged commit 7e66d55 into main Nov 14, 2023
50 of 51 checks passed
@meltsufin meltsufin deleted the emulator-root branch November 14, 2023 17:13
@arturomelo-kareo
Copy link

@meltsufin Could you merge this PR into the 3.x branch and release it, please?

I filed the bug here: #2330

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants