3 Commits

Author SHA1 Message Date
Zac West
85b5ec4579
Support attachments which aren't downloaded in advance (#1610)
## Summary
Allows attachments to be loaded on-the-fly in the content extension if they are not present.

## Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#510

## Any other notes
- Adds `lazy` as an option to the `attachment` dictionary. When true, this prevents the attachment from being downloaded except when displayed in the content extension.  
  
This is similar, but not identical, to hide-thumbnail. Hiding the thumbnail still uses the internal storage of the notifications which are limited to e.g. 50mb. However, we'd still want to pre-load those attachments even if the thumbnail is hidden.
- Retries non-lazy attachments which failed due to a network error when the content extension opens.
2021-05-01 12:58:30 -07:00
Zac West
640cca884b
Add SwiftFormat to project (#1463)
Adds new fastlane lanes:
- `fastlane lint` which checks the linters
- `fastlane autocorrect` which applies the linters which can autocorrect (Rubocop, SwiftFormat)

Adds a build step to the Codegen abstract target which runs SwiftFormat in lint mode, pointing out what it's going to change when run.

Applies SwiftFormat to nearly all code -- exempts a few externally-sourced files and generated code.
2021-02-05 22:06:25 -08:00
Zac West
8ed37f02d4
Update notification attachment handling, add error images (#1301)
## Summary
- Refactors notification attachment into smaller units. Adds tests.
- Adds an image attachment with whatever the error reason is when an attachment fails to download.
- Adds a Shared framework scheme which can run just its tests. It's a bit faster than doing the whole app which has a lot of extensions and watchOS targets.

## Screenshots
![Image](https://user-images.githubusercontent.com/74188/102575375-d4de8100-40a7-11eb-868f-d19b60710bf7.PNG)

## Any other notes
This does not (yet?) create the error images for the service timeout. Not sure how relevant that may end up. I haven't yet come across a case of this happening in logs and being confusing.
2020-12-17 23:10:17 -08:00