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

Don't delete uploaded logs #3540

Merged
merged 3 commits into from
Oct 1, 2024
Merged

Conversation

jmartinesp
Copy link
Member

Content

Remove code in DefaultBugReporter that deleted all existing log files except for the most recent one.

Motivation and context

The log removal happened after the logs had been compressed but before we were sure they had reached their destination. Since Rust already takes care of the log roration there's no need for this code AFAICT, and it could cause accidental log data loss.

Tests

  • Send a bug report.
  • Send another or check the files in your device with adb.

The log files should be kept.

Tested devices

  • Physical
  • Emulator
  • OS version(s): 14

Checklist

  • Changes have been tested on an Android device or Android emulator with API 23
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly define what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • Pull request includes a sign off
  • You've made a self review of your PR

@jmartinesp jmartinesp requested a review from a team as a code owner September 25, 2024 15:38
@jmartinesp jmartinesp requested review from ganfra and removed request for a team September 25, 2024 15:38
@jmartinesp jmartinesp added the PR-Bugfix For bug fix label Sep 25, 2024
Copy link
Contributor

github-actions bot commented Sep 25, 2024

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/hQoVBc

Copy link

codecov bot commented Sep 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.69%. Comparing base (3001efb) to head (1df46ff).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3540   +/-   ##
========================================
  Coverage    82.68%   82.69%           
========================================
  Files         1732     1732           
  Lines        40983    40977    -6     
  Branches      4966     4964    -2     
========================================
- Hits         33888    33887    -1     
+ Misses        5341     5337    -4     
+ Partials      1754     1753    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ganfra
Copy link
Member

ganfra commented Sep 26, 2024

Are you sure rust sdk is cleaning them? At the time I implemented that it wasn't the case

@jmartinesp
Copy link
Member Author

Are you sure rust sdk is cleaning them? At the time I implemented that it wasn't the case

It should be, we're internally using this:

image

Also, that was over a year ago, I think 😅 .

@ganfra
Copy link
Member

ganfra commented Sep 26, 2024

Nice, what "n" are we using?

@jmartinesp
Copy link
Member Author

jmartinesp commented Sep 26, 2024

Nice, what "n" are we using?

// Keep a maximum of 1 week of log files.
numberOfFiles = 7 * 24,

In any case, I'm testing this right now. But since new files are only written every hour, I need to wait for a bit 🫠 .

@jmartinesp
Copy link
Member Author

In any case, I'm testing this right now.

Well, color me surprised, it doesn't, or not under some circumstances: I lowered the max value to 2 and I have still all my logs here.

@bmarty bmarty marked this pull request as draft September 27, 2024 08:13
@bmarty
Copy link
Member

bmarty commented Sep 27, 2024

(We hold on until we are sure that the SDK is deleting the files during the rotation).

@jmartinesp
Copy link
Member Author

matrix-org/matrix-rust-sdk#4038 is now merged, we'd need a new SDK version and we can both fix the bud and remove this code.

@jmartinesp
Copy link
Member Author

We now have the right log rotation code since #3553.

@jmartinesp jmartinesp marked this pull request as ready for review September 27, 2024 12:07
Copy link

sonarcloud bot commented Oct 1, 2024

@jmartinesp jmartinesp added the Run-Maestro Starts a Maestro Cloud session to run integration tests label Oct 1, 2024
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label Oct 1, 2024
@jmartinesp
Copy link
Member Author

I just re-tested this and I can confirm old logs are now being removed so this code is no longer needed.

@jmartinesp jmartinesp merged commit 1d5509e into develop Oct 1, 2024
30 checks passed
@jmartinesp jmartinesp deleted the fix/jme/do-not-delete-uploaded-logs branch October 1, 2024 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Bugfix For bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants