Skip to content

Fix the way of gzipping and base64. This is now consistent with server #3414

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

Merged
merged 8 commits into from
Feb 19, 2022

Conversation

VinayGuthal
Copy link
Contributor

@VinayGuthal VinayGuthal commented Feb 7, 2022

Fix the way of gzipping and base64. This is now consistent with server. Tests added to the server side as well.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Feb 7, 2022

Size Report 1

Affected Products

  • firebase-common

    TypeBase (e8659b5)Merge (db6980a)Diff
    aar47.8 kB48.0 kB+200 B (+0.4%)
    apk (release)680 kB680 kB+88 B (+0.0%)

Test Logs

Notes

  • Commit (db6980a) is created by Prow via merging PR base commit (e8659b5) and head commit (b6a8d3a).

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/stgJoEnz69.html

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Feb 7, 2022

Coverage Report 1

Affected Products

  • firebase-common

    Overall coverage changed from 65.21% (e8659b5) to 65.16% (db6980a) by -0.05%.

    FilenameBase (e8659b5)Merge (db6980a)Diff
    DefaultHeartBeatController.java94.12%94.03%-0.09%

Test Logs

Notes

  • Commit (db6980a) is created by Prow via merging PR base commit (e8659b5) and head commit (b6a8d3a).
  • Run gradle <product>:checkCoverage to produce HTML coverage reports locally. After gradle commands finished, report files can be found under <product-build-dir>/reports/jacoco/.

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/ytfqYXxq1k.html

@VinayGuthal VinayGuthal changed the title Change fis end point for testing Fix the way of gzipping and base64. This is now consistent with server Feb 15, 2022
Comment on lines +208 to +214
ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream();
try {
try (GZIPOutputStream gzipOutputStream = new GZIPOutputStream(byteOutputStream)) {
gzipOutputStream.write(input.getBytes(UTF_8));
}
byte[] gzipped = byteOutputStream.toByteArray();
byteOutputStream.close();
Copy link
Member

Choose a reason for hiding this comment

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

Looks like you can use try with resources here as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it complains saying byte[] is not a proper type for try with resources.

Copy link
Collaborator

Choose a reason for hiding this comment

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

AFAIK not closing it is OK.

https://docs.oracle.com/javase/7/docs/api/java/io/ByteArrayOutputStream.html#close()

Closing a ByteArrayOutputStream has no effect. The methods in this class can be called after the stream has been closed without generating an IOException.

@VinayGuthal VinayGuthal merged commit 9dec703 into master Feb 19, 2022
@VinayGuthal VinayGuthal deleted the fis_test_pr branch February 19, 2022 04:50
jeremyjiang-dev pushed a commit that referenced this pull request Mar 9, 2022
#3414)

* push test pr

* fix platform logging header request

* small fixes

* use try

* fix tests

* use strings

* update

* gJF
@firebase firebase locked and limited conversation to collaborators Mar 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants