Skip to content

Commit

Permalink
Merge pull request #158 from DP-3T/release/1.0.5
Browse files Browse the repository at this point in the history
Version 1.0.5
  • Loading branch information
UBaggeler authored Jun 23, 2020
2 parents 83d5028 + c6337f1 commit b8a1b4e
Show file tree
Hide file tree
Showing 11 changed files with 208 additions and 154 deletions.
182 changes: 126 additions & 56 deletions .github/workflows/distribute.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
name: testflight
name: appstore

on:
push:
branches-ignore:
- '**'

#on:
# push:
# branches:
# - master
# - release
# pull_request:
# branches:
# - master
branches:
- master


jobs:
testflight_dev:
appstore_dev:
runs-on: macOS-latest

steps:
Expand All @@ -30,10 +22,19 @@ jobs:
- name: Installs magick
run: brew install imagemagick

- name: Remove current version of Pango (contains a bug)
run: brew unlink pango

- name: Install older version of Pango
run: brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/7cf3b63be191cb2ce4cd86f4406915128ec97432/Formula/pango.rb

- name: Use older version of Pango
run: brew switch pango 1.42.4_1

- name: Sets up bundler
run: bundle update --bundler

- name: Sign and build
- name: Build and Sign
env:
MATCH_GIT_URL: ${{ secrets.MATCH_GIT_URL }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
Expand All @@ -43,17 +44,31 @@ jobs:
APP_IDENTIFIER: ${{ secrets.APP_IDENTIFIER_DEV }}
FASTLANE_TEAM_ID: ${{ secrets.TEAM_ID }}
BADGE_TITLE: "DEV"
run: bundle exec fastlane sign_and_build

- name: Upload and distribution
env:
FASTLANE_USER: ${{ secrets.FASTLANE_USER }}
FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }}
REVIEW_CONTACT_EMAIL: ${{ secrets.REVIEW_CONTACT_EMAIL }}
REVIEW_CONTACT_PHONE: ${{ secrets.REVIEW_CONTACT_PHONE }}
run: bundle exec fastlane upload_and_distribute
run: bundle exec fastlane build_and_sign

- name: SHA256
run: shasum -a 256 build/SwissCovid.ipa

- name: Archive ipa file
uses: actions/upload-artifact@v2
with:
name: AppStore_DEV_SwissCovid.ipa
path: build/SwissCovid.ipa

- name: Archive xcarchive (incl symbols) files
uses: actions/upload-artifact@v2
with:
name: AppStore_DEV_SwissCovid.xcarchive
path: "build/SwissCovid.xcarchive"

- name: Archive log file
uses: actions/upload-artifact@v2
with:
name: AppStore_DEV_Build.log
path: "build/build.log"


testflight_test:
appstore_test:
runs-on: macOS-latest

steps:
Expand All @@ -68,10 +83,19 @@ jobs:
- name: Installs magick
run: brew install imagemagick

- name: Remove current version of Pango (contains a bug)
run: brew unlink pango

- name: Install older version of Pango
run: brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/7cf3b63be191cb2ce4cd86f4406915128ec97432/Formula/pango.rb

- name: Use older version of Pango
run: brew switch pango 1.42.4_1

- name: Sets up bundler
run: bundle update --bundler

- name: Sign and build
- name: Build and Sign
env:
MATCH_GIT_URL: ${{ secrets.MATCH_GIT_URL }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
Expand All @@ -80,18 +104,32 @@ jobs:
APP_SCHEME: "Release-Test"
APP_IDENTIFIER: ${{ secrets.APP_IDENTIFIER_TEST }}
FASTLANE_TEAM_ID: ${{ secrets.TEAM_ID }}
BADGE_TITLE: "DEV"
run: bundle exec fastlane sign_and_build

- name: Upload and distribution
env:
FASTLANE_USER: ${{ secrets.FASTLANE_USER }}
FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }}
REVIEW_CONTACT_EMAIL: ${{ secrets.REVIEW_CONTACT_EMAIL }}
REVIEW_CONTACT_PHONE: ${{ secrets.REVIEW_CONTACT_PHONE }}
run: bundle exec fastlane upload_and_distribute
BADGE_TITLE: "TEST"
run: bundle exec fastlane build_and_sign

testflight_abnahme:
- name: SHA256
run: shasum -a 256 build/SwissCovid.ipa

- name: Archive ipa file
uses: actions/upload-artifact@v2
with:
name: AppStore_TEST_SwissCovid.ipa
path: build/SwissCovid.ipa

- name: Archive xcarchive (incl symbols) files
uses: actions/upload-artifact@v2
with:
name: AppStore_TEST_SwissCovid.xcarchive
path: "build/SwissCovid.xcarchive"

- name: Archive log file
uses: actions/upload-artifact@v2
with:
name: AppStore_TEST_Build.log
path: "build/build.log"


appstore_abnahme:
runs-on: macOS-latest

steps:
Expand All @@ -106,10 +144,19 @@ jobs:
- name: Installs magick
run: brew install imagemagick

- name: Remove current version of Pango (contains a bug)
run: brew unlink pango

- name: Install older version of Pango
run: brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/7cf3b63be191cb2ce4cd86f4406915128ec97432/Formula/pango.rb

- name: Use older version of Pango
run: brew switch pango 1.42.4_1

- name: Sets up bundler
run: bundle update --bundler

- name: Sign and build
- name: Build and Sign
env:
MATCH_GIT_URL: ${{ secrets.MATCH_GIT_URL }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
Expand All @@ -119,17 +166,31 @@ jobs:
APP_IDENTIFIER: ${{ secrets.APP_IDENTIFIER_ABNAHME }}
FASTLANE_TEAM_ID: ${{ secrets.TEAM_ID }}
BADGE_TITLE: "ABN"
run: bundle exec fastlane sign_and_build

- name: Upload and distribution
env:
FASTLANE_USER: ${{ secrets.FASTLANE_USER }}
FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }}
REVIEW_CONTACT_EMAIL: ${{ secrets.REVIEW_CONTACT_EMAIL }}
REVIEW_CONTACT_PHONE: ${{ secrets.REVIEW_CONTACT_PHONE }}
run: bundle exec fastlane upload_and_distribute
run: bundle exec fastlane build_and_sign

- name: SHA256
run: shasum -a 256 build/SwissCovid.ipa

testflight_prod:
- name: Archive ipa file
uses: actions/upload-artifact@v2
with:
name: AppStore_ABNAHME_SwissCovid.ipa
path: build/SwissCovid.ipa

- name: Archive xcarchive (incl symbols) files
uses: actions/upload-artifact@v2
with:
name: AppStore_ABNAHME_SwissCovid.xcarchive
path: "build/SwissCovid.xcarchive"

- name: Archive log file
uses: actions/upload-artifact@v2
with:
name: AppStore_ABNAHME_Build.log
path: "build/build.log"


appstore_prod:
runs-on: macOS-latest

steps:
Expand All @@ -141,7 +202,7 @@ jobs:
- name: Sets up bundler
run: bundle update --bundler

- name: Sign and build
- name: Build and Sign
env:
MATCH_GIT_URL: ${{ secrets.MATCH_GIT_URL }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
Expand All @@ -152,16 +213,25 @@ jobs:
FASTLANE_TEAM_ID: ${{ secrets.TEAM_ID }}
SKIP_ADD_BADGE: true
BADGE_TITLE: ""
run: bundle exec fastlane sign_and_build
run: bundle exec fastlane build_and_sign

- name: SHA256
run: shasum -a 256 build/SwissCovid.ipa

- name: Archive ipa file
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v2
with:
name: AppStore_PROD_SwissCovid.ipa
path: build/SwissCovid.ipa

- name: Archive xcarchive (incl symbols) files
uses: actions/upload-artifact@v2
with:
name: dp3t.ipa
path: "DP3TApp.ipa"
name: AppStore_PROD_SwissCovid.xcarchive
path: "build/SwissCovid.xcarchive"

- name: Archive dSYM files
uses: actions/upload-artifact@v1
- name: Archive log file
uses: actions/upload-artifact@v2
with:
name: dp3t_dSYMs.zip
path: "DP3TApp.app.dSYM.zip"
name: AppStore_PROD_Build.log
path: "build/build.log"
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"repositoryURL": "https://github.com/DP-3T/dp3t-sdk-ios.git",
"state": {
"branch": "develop",
"revision": "818bb6f6febfa2297820b15d824246ac778669a5",
"revision": "fcb11aa6d9cd10b6188e2d2838ba1e16eaea5450",
"version": null
}
},
Expand Down
10 changes: 9 additions & 1 deletion DP3TApp/Logic/Tracing/DatabaseSyncer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/

import Foundation

import ExposureNotification
import DP3TSDK

class DatabaseSyncer {
Expand Down Expand Up @@ -81,6 +81,7 @@ class DatabaseSyncer {
UIStateManager.shared.lastSyncErrorTime = Date()
switch wrappedError {
case let .networkSessionError(netErr as NSError) where netErr.code == -999 && netErr.domain == NSURLErrorDomain:
// Certificate error
UIStateManager.shared.immediatelyShowSyncError = false
UIStateManager.shared.syncErrorIsNetworkError = true
case let .HTTPFailureResponse(status: status) where status == 502 || status == 503:
Expand All @@ -91,11 +92,16 @@ class DatabaseSyncer {
UIStateManager.shared.immediatelyShowSyncError = false
UIStateManager.shared.syncErrorIsNetworkError = true
case .timeInconsistency:
UIStateManager.shared.immediatelyShowSyncError = true
UIStateManager.shared.hasTimeInconsistencyError = true
UIStateManager.shared.syncErrorIsNetworkError = false
default:
UIStateManager.shared.immediatelyShowSyncError = true
UIStateManager.shared.syncErrorIsNetworkError = false
}
case let .exposureNotificationError(error: expError as ENError) where expError.code == ENError.Code.rateLimited:
// never show the ratelimit error to the user
UIStateManager.shared.syncError = nil
case .cancelled:
// background task got cancelled, dont show error immediately
UIStateManager.shared.immediatelyShowSyncError = false
Expand All @@ -120,6 +126,8 @@ class DatabaseSyncer {
UIStateManager.shared.lastSyncErrorTime = nil
UIStateManager.shared.hasTimeInconsistencyError = false
UIStateManager.shared.immediatelyShowSyncError = false
UIStateManager.shared.syncErrorIsNetworkError = false
UIStateManager.shared.syncError = nil
}

// wait another 2 days befor warning
Expand Down
34 changes: 33 additions & 1 deletion DP3TApp/Logic/Tracing/UIState/Errors+Localized.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,20 @@ import DP3TSDK
/// Only CodedError should be used in the UI and UI State
/// All errors that are generated by the SDK or the app should conform to this protocol
protocol CodedError: Error {
var errorTitle: String? { get }
var errorCodeString: String? { get }
}

extension DP3TTracingError: LocalizedError, CodedError {
var errorTitle: String? {
switch self {
case let .networkingError(error: wrapped):
return wrapped.errorTitle
default:
return nil
}
}

public var errorDescription: String? {
let unexpected = "unexpected_error_title".ub_localized
switch self {
Expand Down Expand Up @@ -67,6 +77,15 @@ extension DP3TTracingError: LocalizedError, CodedError {
}

extension DP3TNetworkingError: LocalizedError, CodedError {
var errorTitle: String? {
switch self {
case .timeInconsistency:
return "time_inconsistency_title".ub_localized
default:
return nil
}
}

public var errorDescription: String? {
switch self {
case let .networkSessionError(error: error):
Expand All @@ -76,13 +95,14 @@ extension DP3TNetworkingError: LocalizedError, CodedError {
}
return "network_error".ub_localized

case .timeInconsistency:
return "time_inconsistency_text".ub_localized
case .notHTTPResponse: fallthrough
case .HTTPFailureResponse: fallthrough
case .noDataReturned: fallthrough
case .couldNotParseData: fallthrough
case .couldNotEncodeBody: fallthrough
case .batchReleaseTimeMissmatch: fallthrough
case .timeInconsistency: fallthrough
case .jwtSignatureError:
return "unexpected_error_title".ub_localized
}
Expand Down Expand Up @@ -114,6 +134,10 @@ extension DP3TNetworkingError: LocalizedError, CodedError {
}

extension NetworkError: LocalizedError, CodedError {
var errorTitle: String? {
nil
}

var errorDescription: String? {
switch self {
case .networkError:
Expand Down Expand Up @@ -144,6 +168,10 @@ extension NetworkError: LocalizedError, CodedError {
/// Since we only want to pass CodedErrors through the app
/// We wrap everything that should not happen
enum UnexpectedThrownError: LocalizedError, CodedError {
var errorTitle: String? {
nil
}

case startTracing(error: Error)

var errorDescription: String? {
Expand All @@ -160,6 +188,10 @@ enum UnexpectedThrownError: LocalizedError, CodedError {
}

extension CertificateValidationError: LocalizedError, CodedError {
var errorTitle: String? {
nil
}

var errorDescription: String? {
return "certificate_validation_error".ub_localized
}
Expand Down
Loading

0 comments on commit b8a1b4e

Please sign in to comment.