Skip to content

Commit 370eb7d

Browse files
authored
Release v3.0.7 (#120)
* [iOS] [13314] Fixes venue map zoom defaults. * Restores OAuth2 access revoked notification handling. Updates aerogear-ios-oauth2 lib. * [iOS] [13370] Splash fallbacks to loaded summit name and date display. * [iOS] [13431] Updates NOW button logic. * Version bump to 3.0.2. * Updates oauth2 lib with token refresh getter fix. * Version bump to 3.0.3. * Updates oauth lib to allow keychain tokens read when device is locked. * Version bump to 3.0.4. * Resets oauth keychain by changing accounts prefix. * Version bump to 3.0.5. * Revert "Version bump to 3.0.5." This reverts commit 35f3d89. * [CoreSummit] [tvOS] Fixed tvOS compiler crash Hopefully this will be fixed in the future * Revert "[CoreSummit] [tvOS] Fixed tvOS compiler crash" This reverts commit fe5647d. * [CoreSummit] Fixes compiler crash. Removes redundant conformance constraint. * Updates ImageSlideshow dependency. For swift(>=3.2) compatibility. * Updates XCDYouTubeKit dependency. * Swift 4 Migration (#117) * [CoreSummit] Fixes closures syntax. * [CoreSummit] Fixes reduce and sorted closures syntax. * [CoreSummit] Fixes range at syntax. * [watchOS] Fixes reduce and sorted closures syntax. * [watchOS] Fixes html to attributed string conversion. * [iOS] Fixes reduce and sorted closures syntax. * [iOS] Fixes closures syntax. * [iOS] Fixes attributed text keys syntax. * [iOS] Adds new function signature to match expected argument type. * [iOS] Disambiguiates type(of: self) usage. * [iOS] Fixes mocked summit store call. * [macOS] Fixes closures syntax. * [macOS] Fixes html to attributed string conversion. * [macOS] Migrates to swift 4 syntax. * [macOS] Makes segues strings into identifiers. * [iOS] Adds missing event kit default calendar unwrapping. * [iOS] Adds @objc attribute for minimal inference. * [tvOS] Fixes closure syntax. * [tvOS] Fixes html to attributed string conversion. * [tvOS] Coverts metadata identifier syntax. * [CoreSummit] Treats string as collection. * [iOS] Treats string as collection. * Updates R.swift.Library dependency. * Updates XLPagerTabStrip dependency. * Updates Cosmos dependency. * Updates project and settings to target swift 4. objc inference still set to match swift 3 behaviour * [iOS] [12678] Rearranges My Summit tabs. * [iOS] Removes schedule view duplicate constraints. * [iOS] Fixes schedule view content view layout bug. * [iOS] Fixes venue detail slideshow full screen image selection. * [iOS] Renames slideshow input source type. * [iOS] [11351] Links location to floor map. * [iOS] [13513] Adds filter by track. * [iOS] [11887] Adds schedule url deep linking. * Renames schedule active dates methods. * [CoreSummit] Fixes summits request. * [iOS] [13776] Improves splash screen transitioning state. * [iOS] [13776] Fixes splash screen logo size. * [iOS] [13776] Adds day counters to splash screen. * [iOS] [13776] Fixes label instances tracking bug. * [iOS] [13776] Fixes summit name bug. * Version bump to 3.0.5. * Fixes delete persistence store call ambiguity. * [iOS] [14023] Fixes filters equatable bug. * [iOS] Adds borders to now button. * [iOS] Updates Google Maps to v2.7.0 * [CoreSummit] Fixes summit data update processing. * Adds data updates unit tests. * Updates Crashalytics dependecy. Fixes: -[ANSWriteEventOperation logLineWithTimestamp:eventName:payloadDictionary:] Raw Text * +[NSJSONSerialization dataWithJSONObject:options:error:]: value parameter is nil * [CoreSummit] Prevents concurrent data update polling. Updates event data update test json data. * [Core Summit] Clears data update storage if no active summit. * [CoreSummit] Skips data update processing if data wiping. Simplifies data update processing error recording. * [CoreSummit] [iOS] Revamps data update error logging to Fabric. * [iOS] Adds logging to view controllers api error. * [iOS] [14135] Changes button wording. * [iOS] [14182] Changes event detail section name wording. * [iOS] [14075] Fixes deep linking UI transitioning. * [iOS] Fixes layout bug caused by front view being pushed again to front. * [iOS] Prevents consecutive presses on menu items. * [iOS] [14218] Changes filter name wording. * [iOS] [14179] Adds filtering by video. * [cespinoza] - #14106 (#119) * Add CONTRIBUTING.md * [CoreSummit] [iOS] Checks allowed3 redirect url to identify IDP deep linking. Defers event viewing after data load completion. * [CoreSummit] Adds auth revoke and retry on service account api calls. * [iOS] Adds event search by presentation speaker or moderator. * [iOS] [14393] Fixes duplicated biography. Caused by race condition. * Version bump to 3.0.7
1 parent 6675e15 commit 370eb7d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+103126
-228
lines changed

CONTRIBUTING.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Contributing to the OpenStack iOS mobile app project
2+
3+
### Pull requests
4+
If you would like to submit code for review, please submit a pull request in the Github repository. The OpenStack iOS app development team will review as soon as possible.
5+
6+
### Reporting bugs / submitting suggestions
7+
If you would like to report a bug or have a recommendation on how to improve the app, please submit a new Issue: https://github.com/OpenStack-mobile/summit-app-ios/issues
8+
9+
### Other issues
10+
If you have any other items that you would like to discuss please contact us at summitapps@openstack.org

OpenStack Summit/CoreSummit/Configuration.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public protocol Configuration {
1515
/// URL of the OpenStack ID server.
1616
static var authenticationURL: String { get }
1717

18-
static var openID: (client: String, secret: String) { get }
18+
static var openID: (client: String, secret: String, allowedRedirectURL: String) { get }
1919

2020
static var serviceAccount: (client: String, secret: String) { get }
2121

OpenStack Summit/CoreSummit/DataUpdatePoller.swift

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,12 @@
66
// Copyright © 2016 OpenStack. All rights reserved.
77
//
88

9-
import Foundation
10-
import JSON
11-
12-
#if os(iOS)
13-
import Crashlytics
14-
import Fabric
15-
#endif
16-
179
public final class DataUpdatePoller {
1810

1911
// MARK: - Properties
2012

13+
public var polling = false
14+
2115
public var pollingInterval: Double = 60
2216

2317
public var log: ((String) -> ())?
@@ -68,12 +62,22 @@ public final class DataUpdatePoller {
6862
guard Reachability.connected else { return }
6963
#endif
7064

65+
// dont poll if already polling
66+
guard !polling else { return }
67+
7168
// dont poll if no active summit
7269
guard let summitID = self.summit,
7370
let summit = try! SummitManagedObject.find(summitID, context: store.managedObjectContext)
74-
else { return }
71+
else {
72+
// clear latest data update after wipe
73+
if let latestDataUpdate = storage.latestDataUpdate {
74+
75+
storage.clear()
76+
}
77+
return
78+
}
7579

76-
log?("Polling server for data updates for summit \(summitID)")
80+
print("Polling server for data updates for summit \(summitID)")
7781

7882
/// Handles the polling of the data updates
7983
func process(response: ErrorValue<[DataUpdate]>) {
@@ -82,35 +86,23 @@ public final class DataUpdatePoller {
8286

8387
case let .error(error):
8488

85-
log?("Error polling server for data updates: \(error)")
89+
let nsError = (error as NSError)
90+
91+
log?("Error polling server: \(nsError.code) - \(nsError.localizedDescription)")
8692

8793
case let .value(dataUpdates):
8894

89-
for update in dataUpdates {
95+
var processedCount = 0
96+
97+
for index in 0..<dataUpdates.count {
98+
99+
let update = dataUpdates[index]
90100

91101
if store.process(dataUpdate: update, summit: summit.id) == false {
92102

93103
// could not process update
94104

95-
#if os(iOS)
96-
97-
var errorUserInfo = [NSLocalizedDescriptionKey: "Could not process data update.", "DataUpdate": "\(update)"]
98-
99-
if let updateEntity = update.entity,
100-
case let .json(jsonObject) = updateEntity {
101-
102-
let jsonString = try! JSON.Value.object(jsonObject).toString(options: .prettyPrint)
103-
104-
errorUserInfo["JSON"] = jsonString
105-
}
106-
107-
let friendlyError = NSError(domain: "CoreSummit", code: -200, userInfo:errorUserInfo)
108-
109-
Crashlytics.sharedInstance().recordError(friendlyError)
110-
111-
#endif
112-
113-
print("Could not process data update: \(update)")
105+
log?("Could not process: \(update.identifier)")
114106

115107
#if DEBUG
116108
return // block
@@ -119,6 +111,15 @@ public final class DataUpdatePoller {
119111

120112
// store latest data update
121113
storage.latestDataUpdate = update.identifier
114+
115+
processedCount = index
116+
117+
// exit loop if data wiping
118+
if update.className == .WipeData &&
119+
update.operation == .truncate {
120+
121+
break
122+
}
122123
}
123124

124125
if dataUpdates.isEmpty == false {
@@ -127,9 +128,11 @@ public final class DataUpdatePoller {
127128

128129
try! context.performErrorBlockAndWait { try context.validateAndSave() }
129130

130-
log?("Processed \(dataUpdates.count) data updates")
131+
print("Processed \(processedCount) data updates")
131132
}
132133
}
134+
135+
polling = false
133136
}
134137

135138
// execute request
@@ -142,6 +145,8 @@ public final class DataUpdatePoller {
142145

143146
store.dataUpdates(summit.id, from: summit.initialDataLoad ?? Date()) { process(response: $0) }
144147
}
148+
149+
polling = true
145150
}
146151
}
147152

OpenStack Summit/CoreSummit/FeedbackRequest.swift

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,28 @@ public extension Store {
2525

2626
http.request(method: .get, path: url) { (responseObject, error) in
2727

28-
// forward error
2928
guard error == nil
30-
else { completion(.error(error!)); return }
29+
else {
30+
31+
if error?.code == 401 {
32+
33+
// revoke and retry
34+
http.authzModule?.revokeAccess { (responseObject, error) in
35+
36+
guard error == nil
37+
else { completion(.error(error!)); return }
38+
39+
self.feedback(summit, event: event, page: page, objectsPerPage: objectsPerPage, completion: completion)
40+
}
41+
}
42+
else {
43+
44+
// forward error
45+
completion(.error(error!))
46+
}
47+
48+
return
49+
}
3150

3251
guard let json = try? JSON.Value(string: responseObject as! String),
3352
let page = Page<Feedback>(json: json)
@@ -62,9 +81,28 @@ public extension Store {
6281

6382
http.request(method: .get, path: url) { (responseObject, error) in
6483

65-
// forward error
6684
guard error == nil
67-
else { completion(.error(error!)); return }
85+
else {
86+
87+
if error?.code == 401 {
88+
89+
// revoke and retry
90+
http.authzModule?.revokeAccess { (responseObject, error) in
91+
92+
guard error == nil
93+
else { completion(.error(error!)); return }
94+
95+
self.averageFeedback(summit, event: event, completion: completion)
96+
}
97+
}
98+
else {
99+
100+
// forward error
101+
completion(.error(error!))
102+
}
103+
104+
return
105+
}
68106

69107
guard let json = try? JSON.Value(string: responseObject as! String),
70108
let jsonObject = json.objectValue,

OpenStack Summit/CoreSummit/ListMembersRequest.swift

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,28 @@ public extension Store {
2929

3030
http.request(method: .get, path: url) { (responseObject, error) in
3131

32-
// forward error
3332
guard error == nil
34-
else { completion(.error(error!)); return }
33+
else {
34+
35+
if error?.code == 401 {
36+
37+
// revoke and retry
38+
http.authzModule?.revokeAccess { (responseObject, error) in
39+
40+
guard error == nil
41+
else { completion(.error(error!)); return }
42+
43+
self.members(filter, sort: sort, page: page, perPage: perPage, completion: completion)
44+
}
45+
}
46+
else {
47+
48+
// forward error
49+
completion(.error(error!))
50+
}
51+
52+
return
53+
}
3554

3655
guard let json = try? JSON.Value(string: responseObject as! String),
3756
let page = Page<Member>(json: json)

OpenStack Summit/CoreSummit/Store.swift

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public final class Store {
2626
public let createPersistentStore: (NSPersistentStoreCoordinator) throws -> NSPersistentStore
2727

2828
/// Block for resetting the persistent store.
29-
public let deletePersistentStore: (NSPersistentStoreCoordinator, NSPersistentStore) throws -> ()
29+
public let deletePersistentStore: ((NSPersistentStoreCoordinator, NSPersistentStore)?) throws -> ()
3030

3131
/// The server targeted environment.
3232
public let environment: Environment
@@ -71,7 +71,7 @@ public final class Store {
7171
session: SessionStorage,
7272
contextConcurrencyType: NSManagedObjectContextConcurrencyType = .mainQueueConcurrencyType,
7373
createPersistentStore: @escaping (NSPersistentStoreCoordinator) throws -> NSPersistentStore,
74-
deletePersistentStore: @escaping (NSPersistentStoreCoordinator, NSPersistentStore) throws -> ()) throws {
74+
deletePersistentStore: @escaping ((NSPersistentStoreCoordinator, NSPersistentStore)?) throws -> ()) throws {
7575

7676
// store values
7777
self.environment = environment
@@ -129,7 +129,7 @@ public final class Store {
129129

130130
public func clear() throws {
131131

132-
try self.deletePersistentStore(persistentStoreCoordinator, persistentStore)
132+
try self.deletePersistentStore((persistentStoreCoordinator, persistentStore))
133133
self.persistentStore = try self.createPersistentStore(persistentStoreCoordinator)
134134

135135
self.managedObjectContext.reset()
@@ -205,7 +205,7 @@ public final class Store {
205205
var config = Config(
206206
base: environment.configuration.authenticationURL,
207207
authzEndpoint: "oauth2/auth",
208-
redirectURL: "org.openstack.ios.openstack-summit://oauthCallback",
208+
redirectURL: environment.configuration.openID.allowedRedirectURL,
209209
accessTokenEndpoint: "oauth2/token",
210210
clientId: environment.configuration.openID.client,
211211
refreshTokenEndpoint: "oauth2/token",
@@ -221,7 +221,8 @@ public final class Store {
221221
config = Config(
222222
base: environment.configuration.authenticationURL,
223223
authzEndpoint: "oauth2/auth",
224-
redirectURL: "org.openstack.ios.openstack-summit://oauthCallback",
224+
// redirectURL not needed for service account, constructors requires it though
225+
redirectURL: "",
225226
accessTokenEndpoint: "oauth2/token",
226227
clientId: environment.configuration.serviceAccount.client,
227228
revokeTokenEndpoint: "oauth2/token/revoke",

OpenStack Summit/CoreSummit/SummitRequest.swift

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public extension Store {
3030

3131
let managedObject = try summit.save(context)
3232

33-
managedObject.initialDataLoad = NSDate() as Date
33+
managedObject.initialDataLoad = Date()
3434

3535
try context.validateAndSave()
3636
}
@@ -61,9 +61,28 @@ public extension Store {
6161

6262
http.request(method: .get, path: url) { (responseObject, error) in
6363

64-
// forward error
6564
guard error == nil
66-
else { completion(.error(error!)); return }
65+
else {
66+
67+
if error?.code == 401 {
68+
69+
// revoke and retry
70+
http.authzModule?.revokeAccess { (responseObject, error) in
71+
72+
guard error == nil
73+
else { completion(.error(error!)); return }
74+
75+
self.summit(identifier, completion: completion)
76+
}
77+
}
78+
else {
79+
80+
// forward error
81+
completion(.error(error!))
82+
}
83+
84+
return
85+
}
6786

6887
guard let json = try? JSON.Value(string: responseObject as! String),
6988
let summit = Summit(json: json)

OpenStack Summit/CoreSummit/SummitsRequest.swift

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,28 @@ public extension Store {
2525

2626
http.request(method: .get, path: url) { (responseObject, error) in
2727

28-
// forward error
2928
guard error == nil
30-
else { completion(.error(error!)); return }
29+
else {
30+
31+
if error?.code == 401 {
32+
33+
// revoke and retry
34+
http.authzModule?.revokeAccess { (responseObject, error) in
35+
36+
guard error == nil
37+
else { completion(.error(error!)); return }
38+
39+
self.summits(page, objectsPerPage: objectsPerPage, completion: completion)
40+
}
41+
}
42+
else {
43+
44+
// forward error
45+
completion(.error(error!))
46+
}
47+
48+
return
49+
}
3150

3251
guard let json = try? JSON.Value(string: responseObject as! String),
3352
let response = SummitsResponse(json: json)

OpenStack Summit/CoreSummit/VenueRoomJSON.swift

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,33 @@ extension VenueRoom: JSONDecodable {
2727
classNameString == VenueRoom.JSONClassName,
2828
let identifier = JSONObject[LocationJSONKey.id.rawValue]?.integerValue,
2929
let name = JSONObject[LocationJSONKey.name.rawValue]?.rawValue as? String,
30-
let venueIdentifier = JSONObject[JSONKey.venue_id.rawValue]?.integerValue,
31-
let floorIdentifier = JSONObject[JSONKey.floor_id.rawValue]?.integerValue
30+
let venueIdentifier = JSONObject[JSONKey.venue_id.rawValue]?.integerValue
3231
else { return nil }
3332

3433
self.identifier = identifier
3534
self.name = name
3635
self.venue = venueIdentifier
37-
self.floor = floorIdentifier > 0 ? floorIdentifier : nil
3836

3937
// optional
38+
if let floorIdentifier = JSONObject[JSONKey.floor_id.rawValue]?.integerValue {
39+
40+
self.floor = floorIdentifier > 0 ? floorIdentifier : nil
41+
42+
} else {
43+
44+
if let floorJSON = JSONObject[JSONKey.floor.rawValue] {
45+
46+
guard let floor = VenueFloor(json: floorJSON)
47+
else { return nil }
48+
49+
self.floor = floor.identifier
50+
51+
} else {
52+
53+
self.floor = nil
54+
}
55+
}
56+
4057
self.descriptionText = JSONObject[LocationJSONKey.description.rawValue]?.rawValue as? String
4158

4259
if let capacity = JSONObject[JSONKey.Capacity.rawValue]?.integerValue {

0 commit comments

Comments
 (0)