diff --git a/.github/workflows/update-feature-branches.yml b/.github/workflows/update-feature-branches.yml index 5e180d2611..b9ea97f4ee 100644 --- a/.github/workflows/update-feature-branches.yml +++ b/.github/workflows/update-feature-branches.yml @@ -17,6 +17,8 @@ env: defaultBranchPattern: "feature_branch/*" defaultMainBranch: "main" triggerTestsLabel: "tests-requested: quick" + branchPrefix: "workflow/auto-merge-feature-branch-" + jobs: list_feature_branches: @@ -85,6 +87,11 @@ jobs: python scripts/gha/install_prereqs_desktop.py python -m pip install requests + - name: Name new branch + run: | + date_str=$(date "+%Y%m%d-%H%M%S") + echo "NEW_BRANCH=${{env.branchPrefix}}${{github.run_number}}-${date_str}" >> $GITHUB_ENV + - name: Create merge PR id: create-pr run: | @@ -115,7 +122,10 @@ jobs: > Created on ${date_str} by [${{github.workflow}} workflow]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID). " - pr_number=$(python scripts/gha/create_pull_request.py --token ${{ steps.generate-token.outputs.token }} --base "${{ matrix.branch_name }}" --head "${main_branch}" --title "${pr_title}" --body "${pr_body}") + git checkout main + git checkout -b "${NEW_BRANCH}" + git push --set-upstream origin "${NEW_BRANCH}" + pr_number=$(python scripts/gha/create_pull_request.py --token ${{ steps.generate-token.outputs.token }} --base "${{ matrix.branch_name }}" --head "${NEW_BRANCH}" --title "${pr_title}" --body "${pr_body}") echo "created_pr_number=${pr_number}" >> $GITHUB_OUTPUT - name: Set test trigger label. diff --git a/app/rest/request_json.h b/app/rest/request_json.h index 9f37830b27..964ffbd529 100644 --- a/app/rest/request_json.h +++ b/app/rest/request_json.h @@ -41,6 +41,7 @@ class RequestJson : public Request { explicit RequestJson(const char* schema) : application_data_(new FbsTypeT()) { flatbuffers::IDLOptions fbs_options; fbs_options.skip_unexpected_fields_in_json = true; + fbs_options.strict_json = true; parser_.reset(new flatbuffers::Parser(fbs_options)); bool parse_status = parser_->Parse(schema); diff --git a/app/rest/tests/request_json_test.cc b/app/rest/tests/request_json_test.cc index 052549c493..058c925c6d 100644 --- a/app/rest/tests/request_json_test.cc +++ b/app/rest/tests/request_json_test.cc @@ -64,8 +64,8 @@ TEST(RequestJsonTest, UpdatePostFields) { request.set_token("abc"); EXPECT_EQ( "{\n" - " token: \"abc\",\n" - " number: 123\n" + " \"token\": \"abc\",\n" + " \"number\": 123\n" "}\n", request.options().post_fields); } diff --git a/auth/src/android/auth_android.cc b/auth/src/android/auth_android.cc index 2f8ccda645..965db474a4 100644 --- a/auth/src/android/auth_android.cc +++ b/auth/src/android/auth_android.cc @@ -195,10 +195,12 @@ void CheckEmulator(AuthData* auth_data) { // Use emulator as long as this env variable is set, regardless its value. if (std::getenv("USE_AUTH_EMULATOR") == nullptr) { - LogDebug("Using Auth Prod for testing."); + LogInfo("Using Auth Prod for testing."); return; } + LogInfo("Using Auth Emulator for testing."); + // Use AUTH_EMULATOR_PORT if it is set to non empty string, // otherwise use the default port. uint32_t port = std::stoi(kEmulatorPort); diff --git a/auth/src/desktop/rpcs/auth_request.cc b/auth/src/desktop/rpcs/auth_request.cc index c9af69f789..77fb7ea07c 100644 --- a/auth/src/desktop/rpcs/auth_request.cc +++ b/auth/src/desktop/rpcs/auth_request.cc @@ -88,6 +88,7 @@ std::string AuthRequest::GetUrl() { } else { std::string url(kHttp); url += emulator_url; + url += "/"; url += kServerURL; return url; } @@ -95,15 +96,15 @@ std::string AuthRequest::GetUrl() { void AuthRequest::CheckEmulator() { if (!emulator_url.empty()) { - LogDebug("Emulator Url already set: %s", emulator_url.c_str()); + LogInfo("Emulator Url already set: %s", emulator_url.c_str()); return; } // Use emulator as long as this env variable is set, regardless its value. if (std::getenv("USE_AUTH_EMULATOR") == nullptr) { - LogDebug("Using Auth Prod for testing."); + LogInfo("Using Auth Prod for testing."); return; } - + LogInfo("Using Auth Emulator."); emulator_url.append(kEmulatorLocalHost); emulator_url.append(":"); // Use AUTH_EMULATOR_PORT if it is set to non empty string, diff --git a/auth/src/ios/auth_ios.mm b/auth/src/ios/auth_ios.mm index e66af55dd6..59a4e3fe3d 100644 --- a/auth/src/ios/auth_ios.mm +++ b/auth/src/ios/auth_ios.mm @@ -160,9 +160,10 @@ void UpdateCurrentUser(AuthData *auth_data) { void CheckEmulator(AuthData *auth_data) { // Use emulator as long as this env variable is set, regardless its value. if (std::getenv("USE_AUTH_EMULATOR") == nullptr) { - LogDebug("Using Auth Prod for testing."); + LogInfo("Using Auth Prod for testing."); return; } + LogInfo("Using Auth Emulator."); // Use AUTH_EMULATOR_PORT if it is set to non empty string, // otherwise use the default port. diff --git a/auth/tests/desktop/rpcs/create_auth_uri_test.cc b/auth/tests/desktop/rpcs/create_auth_uri_test.cc index e46b5bb49a..91a393f441 100644 --- a/auth/tests/desktop/rpcs/create_auth_uri_test.cc +++ b/auth/tests/desktop/rpcs/create_auth_uri_test.cc @@ -36,8 +36,8 @@ TEST(CreateAuthUriTest, TestCreateAuthUriRequest) { request.options().url); EXPECT_EQ( "{\n" - " identifier: \"email\",\n" - " continueUri: \"http://localhost\"\n" + " \"identifier\": \"email\",\n" + " \"continueUri\": \"http://localhost\"\n" "}\n", request.options().post_fields); } diff --git a/auth/tests/desktop/rpcs/delete_account_test.cc b/auth/tests/desktop/rpcs/delete_account_test.cc index d24c72be6b..e6d8a98bcf 100644 --- a/auth/tests/desktop/rpcs/delete_account_test.cc +++ b/auth/tests/desktop/rpcs/delete_account_test.cc @@ -37,7 +37,7 @@ TEST(DeleteAccountTest, TestDeleteAccountRequest) { request.options().url); EXPECT_EQ( "{\n" - " idToken: \"token\"\n" + " \"idToken\": \"token\"\n" "}\n", request.options().post_fields); } diff --git a/auth/tests/desktop/rpcs/get_account_info_test.cc b/auth/tests/desktop/rpcs/get_account_info_test.cc index 4822bd2e9c..368b079b93 100644 --- a/auth/tests/desktop/rpcs/get_account_info_test.cc +++ b/auth/tests/desktop/rpcs/get_account_info_test.cc @@ -36,7 +36,7 @@ TEST(GetAccountInfoTest, TestGetAccountInfoRequest) { request.options().url); EXPECT_EQ( "{\n" - " idToken: \"token\"\n" + " \"idToken\": \"token\"\n" "}\n", request.options().post_fields); } diff --git a/auth/tests/desktop/rpcs/get_oob_confirmation_code_test.cc b/auth/tests/desktop/rpcs/get_oob_confirmation_code_test.cc index c6a20fd7e1..cf9717853d 100644 --- a/auth/tests/desktop/rpcs/get_oob_confirmation_code_test.cc +++ b/auth/tests/desktop/rpcs/get_oob_confirmation_code_test.cc @@ -40,8 +40,8 @@ TEST(GetOobConfirmationCodeTest, SendVerifyEmailRequest) { request->options().url); EXPECT_EQ( "{\n" - " idToken: \"token\",\n" - " requestType: \"VERIFY_EMAIL\"\n" + " \"idToken\": \"token\",\n" + " \"requestType\": \"VERIFY_EMAIL\"\n" "}\n", request->options().post_fields); } @@ -56,8 +56,8 @@ TEST(GetOobConfirmationCodeTest, SendPasswordResetEmailRequest) { request->options().url); EXPECT_EQ( "{\n" - " email: \"email\",\n" - " requestType: \"PASSWORD_RESET\"\n" + " \"email\": \"email\",\n" + " \"requestType\": \"PASSWORD_RESET\"\n" "}\n", request->options().post_fields); } diff --git a/auth/tests/desktop/rpcs/reset_password_test.cc b/auth/tests/desktop/rpcs/reset_password_test.cc index 480168b9d3..2901ca596e 100644 --- a/auth/tests/desktop/rpcs/reset_password_test.cc +++ b/auth/tests/desktop/rpcs/reset_password_test.cc @@ -35,8 +35,8 @@ TEST(ResetPasswordTest, TestResetPasswordRequest) { request.options().url); EXPECT_EQ( "{\n" - " oobCode: \"oob\",\n" - " newPassword: \"password\"\n" + " \"oobCode\": \"oob\",\n" + " \"newPassword\": \"password\"\n" "}\n", request.options().post_fields); } diff --git a/auth/tests/desktop/rpcs/secure_token_test.cc b/auth/tests/desktop/rpcs/secure_token_test.cc index 217b148d8a..ff6fd589c4 100644 --- a/auth/tests/desktop/rpcs/secure_token_test.cc +++ b/auth/tests/desktop/rpcs/secure_token_test.cc @@ -34,8 +34,8 @@ TEST(SecureTokenTest, TestSetRefreshRequest) { request.options().url); EXPECT_EQ( "{\n" - " grantType: \"refresh_token\",\n" - " refreshToken: \"token123\"\n" + " \"grantType\": \"refresh_token\",\n" + " \"refreshToken\": \"token123\"\n" "}\n", request.options().post_fields); } diff --git a/auth/tests/desktop/rpcs/set_account_info_test.cc b/auth/tests/desktop/rpcs/set_account_info_test.cc index 0a591ea44f..ce38726238 100644 --- a/auth/tests/desktop/rpcs/set_account_info_test.cc +++ b/auth/tests/desktop/rpcs/set_account_info_test.cc @@ -41,9 +41,9 @@ TEST(SetAccountInfoTest, TestSetAccountInfoRequest_UpdateEmail) { request->options().url); EXPECT_EQ( "{\n" - " email: \"fakeemail\",\n" - " returnSecureToken: true,\n" - " idToken: \"token\"\n" + " \"email\": \"fakeemail\",\n" + " \"returnSecureToken\": true,\n" + " \"idToken\": \"token\"\n" "}\n", request->options().post_fields); } @@ -60,9 +60,9 @@ TEST(SetAccountInfoTest, TestSetAccountInfoRequest_UpdatePassword) { request->options().url); EXPECT_EQ( "{\n" - " password: \"fakepassword\",\n" - " returnSecureToken: true,\n" - " idToken: \"token\"\n" + " \"password\": \"fakepassword\",\n" + " \"returnSecureToken\": true,\n" + " \"idToken\": \"token\"\n" "}\n", request->options().post_fields); } @@ -79,10 +79,10 @@ TEST(SetAccountInfoTest, TestSetAccountInfoRequest_UpdateProfile_Full) { request->options().url); EXPECT_EQ( "{\n" - " displayName: \"New Name\",\n" - " returnSecureToken: true,\n" - " idToken: \"token\",\n" - " photoUrl: \"new_url\"\n" + " \"displayName\": \"New Name\",\n" + " \"returnSecureToken\": true,\n" + " \"idToken\": \"token\",\n" + " \"photoUrl\": \"new_url\"\n" "}\n", request->options().post_fields); } @@ -99,9 +99,9 @@ TEST(SetAccountInfoTest, TestSetAccountInfoRequest_UpdateProfile_Partial) { request->options().url); EXPECT_EQ( "{\n" - " returnSecureToken: true,\n" - " idToken: \"token\",\n" - " photoUrl: \"new_url\"\n" + " \"returnSecureToken\": true,\n" + " \"idToken\": \"token\",\n" + " \"photoUrl\": \"new_url\"\n" "}\n", request->options().post_fields); } @@ -117,9 +117,9 @@ TEST(SetAccountInfoTest, TestSetAccountInfoRequest_UpdateProfile_DeleteFields) { request->options().url); EXPECT_EQ( "{\n" - " returnSecureToken: true,\n" - " idToken: \"token\",\n" - " deleteAttribute: [\n" + " \"returnSecureToken\": true,\n" + " \"idToken\": \"token\",\n" + " \"deleteAttribute\": [\n" " \"DISPLAY_NAME\",\n" " \"PHOTO_URL\"\n" " ]\n" @@ -140,10 +140,10 @@ TEST(SetAccountInfoTest, request->options().url); EXPECT_EQ( "{\n" - " returnSecureToken: true,\n" - " idToken: \"token\",\n" - " photoUrl: \"new_url\",\n" - " deleteAttribute: [\n" + " \"returnSecureToken\": true,\n" + " \"idToken\": \"token\",\n" + " \"photoUrl\": \"new_url\",\n" + " \"deleteAttribute\": [\n" " \"DISPLAY_NAME\"\n" " ]\n" "}\n", @@ -162,9 +162,9 @@ TEST(SetAccountInfoTest, TestSetAccountInfoRequest_Unlink) { request->options().url); EXPECT_EQ( "{\n" - " returnSecureToken: true,\n" - " idToken: \"token\",\n" - " deleteProvider: [\n" + " \"returnSecureToken\": true,\n" + " \"idToken\": \"token\",\n" + " \"deleteProvider\": [\n" " \"fakeprovider\"\n" " ]\n" "}\n", diff --git a/auth/tests/desktop/rpcs/sign_up_new_user_test.cc b/auth/tests/desktop/rpcs/sign_up_new_user_test.cc index 870deb0fd5..a7b3374bce 100644 --- a/auth/tests/desktop/rpcs/sign_up_new_user_test.cc +++ b/auth/tests/desktop/rpcs/sign_up_new_user_test.cc @@ -35,7 +35,7 @@ TEST(SignUpNewUserTest, TestAnonymousSignInRequest) { request.options().url); EXPECT_EQ( "{\n" - " returnSecureToken: true\n" + " \"returnSecureToken\": true\n" "}\n", request.options().post_fields); } @@ -50,10 +50,10 @@ TEST(SignUpNewUserTest, TestEmailPasswordSignInRequest) { request.options().url); EXPECT_EQ( "{\n" - " email: \"e@mail\",\n" - " password: \"pwd\",\n" - " displayName: \"rabbit\",\n" - " returnSecureToken: true\n" + " \"email\": \"e@mail\",\n" + " \"password\": \"pwd\",\n" + " \"displayName\": \"rabbit\",\n" + " \"returnSecureToken\": true\n" "}\n", request.options().post_fields); } diff --git a/auth/tests/desktop/rpcs/verify_custom_token_test.cc b/auth/tests/desktop/rpcs/verify_custom_token_test.cc index 49241c9ef0..7d4341d37b 100644 --- a/auth/tests/desktop/rpcs/verify_custom_token_test.cc +++ b/auth/tests/desktop/rpcs/verify_custom_token_test.cc @@ -36,8 +36,8 @@ TEST(VerifyCustomTokenTest, TestVerifyCustomTokenRequest) { request.options().url); EXPECT_EQ( "{\n" - " returnSecureToken: true,\n" - " token: \"token123\"\n" + " \"returnSecureToken\": true,\n" + " \"token\": \"token123\"\n" "}\n", request.options().post_fields); } diff --git a/auth/tests/desktop/rpcs/verify_password_test.cc b/auth/tests/desktop/rpcs/verify_password_test.cc index 8fe1b1ee25..0383245467 100644 --- a/auth/tests/desktop/rpcs/verify_password_test.cc +++ b/auth/tests/desktop/rpcs/verify_password_test.cc @@ -35,9 +35,9 @@ TEST(VerifyPasswordTest, TestVerifyPasswordRequest) { request.options().url); EXPECT_EQ( "{\n" - " email: \"abc@email\",\n" - " password: \"pwd\",\n" - " returnSecureToken: true\n" + " \"email\": \"abc@email\",\n" + " \"password\": \"pwd\",\n" + " \"returnSecureToken\": true\n" "}\n", request.options().post_fields); } diff --git a/cpp_sdk_version.json b/cpp_sdk_version.json index 0b4e474adf..0eb24cc9c4 100644 --- a/cpp_sdk_version.json +++ b/cpp_sdk_version.json @@ -1,5 +1,5 @@ { - "released": "11.3.0", - "stable": "11.3.0", - "head": "11.3.0" + "released": "11.4.0", + "stable": "11.4.0", + "head": "11.4.0" } diff --git a/gma/src/android/native_ad_image_android.cc b/gma/src/android/native_ad_image_android.cc index 8c63c9b244..23af8c4fb2 100644 --- a/gma/src/android/native_ad_image_android.cc +++ b/gma/src/android/native_ad_image_android.cc @@ -71,6 +71,15 @@ NativeAdImage::NativeAdImage( FIREBASE_ASSERT(j_uri); internal_->uri = util::JniUriToString(env, j_uri); + // Images requested with an android user agent may return webp images. Trim + // webp parameter from image url to get the original JPG/PNG image. + std::size_t eq_pos = internal_->uri.rfind("="); + std::size_t webp_pos = internal_->uri.rfind("-rw"); + if (webp_pos != std::string::npos && eq_pos != std::string::npos && + webp_pos > eq_pos) { + internal_->uri.replace(webp_pos, 3, ""); + } + // NativeAdImage scale. jdouble j_scale = env->CallDoubleMethod(internal_->native_ad_image, diff --git a/release_build_files/readme.md b/release_build_files/readme.md index 788ce32f29..9b03e10cdb 100644 --- a/release_build_files/readme.md +++ b/release_build_files/readme.md @@ -627,6 +627,12 @@ workflow use only during the development of your app, not for publicly shipping code. ## Release Notes +### Next Release +- Changes + - Auth: Add Firebase Auth Emulator support. Set the environment variable + USE_AUTH_EMULATOR=yes (and optionally AUTH_EMULATOR_PORT, default 9099) + to connect to the local Firebase Auth Emulator. + ### 11.4.0 - Changes - General (Android): Update to Firebase Android BoM version 32.2.2.