8000 [PM-19621] Add share and delete options for flight recorder logs by matt-livefront · Pull Request #1519 · bitwarden/ios · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[PM-19621] Add share and delete options for flight recorder logs #1519

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 3 commits into from
Apr 29, 2025

Conversation

matt-livefront
Copy link
Collaborator
@matt-livefront matt-livefront commented Apr 22, 2025

🎟️ Tracking

PM-19621

📔 Objective

Adds the share and deletion option for flight recorder logs.

📸 Screenshots

Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-04-22.at.16.26.20.mp4

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@matt-livefront matt-livefront requested a review from a team as a code owner April 22, 2025 21:27
Copy link
Contributor
github-actions bot commented Apr 22, 2025

Logo
Checkmarx One – Scan Summary & Details696552c1-99ef-4238-b327-3028da46a8ea

Great job, no security vulnerabilities found in this Pull Request

Copy link
codecov bot commented Apr 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.71%. Comparing base (aa21aec) to head (aec2a18).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1519      +/-   ##
==========================================
+ Coverage   89.67%   89.71%   +0.04%     
==========================================
  Files         779      779              
  Lines       49117    49239     +122     
==========================================
+ Hits        44044    44176     +132     
+ Misses       5073     5063      -10     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor
@KatherineInCode KatherineInCode left a comment

Choose a reason for hiding this comment

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

On the whole looks good, just a few questions.

await stateService.setFlightRecorderData(data)
}

func deleteLog(_ log: FlightRecorderLogMetadata) async throws {
Copy link
Contributor

Choose a reason for hiding this comment

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

🤔 Would it make sense to have deleteArchivedLogs just call this function instead of doing the delete itself? Or is it just not worth doing the guard checks?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good question. I think in that case, we would need to convert the log to a FlightRecorderLogMetadata and it would result in writing out the updated FlightRecorderData to user defaults for each log that's being deleted. I did refactor the do...catch block that does the actual delete into a separate method in some more recent changes though which ends up removing most of the duplication between them.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I missed that they were different enough objects. Makes sense, then.

private func deleteAllLogs() {
confirmDeletion(isBulkDeletion: true) {
do {
try await self.services.flightRecorder.deleteArchivedLogs()
Copy link
Contributor

Choose a reason for hiding this comment

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

🤔 Is there a reason for the verbiage shift from "all logs" to "archived logs", or is this just a difference in how it's presented to the user vs. how we organize it internally?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

a difference in how it's presented to the user vs. how we organize it internally?

Yeah, the UI refers to it as "all logs", but I was trying to be more precise in the services definition to make it clear that it only deletes any archived logs and not the active log. This seemed like the best place to draw that line, but I do see the potential confusion 🤔.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe deleteNonActiveLogs or deleteInactiveLogs to be a bit more clear? 🤔 the distinction absolutely makes sense, though—I just was expecting "archive" to be something a user could do to a log as well. I think it's ultimately fine either way, just confused me for a bit.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah, I'll rename it to inactive, I think that'll be more clear.

Base automatically changed from matt/PM-19577-flight-recorder-view-logs to main April 29, 2025 14:35
@matt-livefront matt-livefront force-pushed the matt/PM-19621-flight-recorder-share-delete branch from 4bd8e78 to aec2a18 Compare April 29, 2025 14:48
@matt-livefront matt-livefront merged commit 5301b34 into main Apr 29, 2025
10 checks passed
@matt-livefront matt-livefront deleted the matt/PM-19621-flight-recorder-share-delete branch April 29, 2025 16:37
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.

2 participants
0