onebusaway-ios
onebusaway-ios copied to clipboard
Fix: issue 629
This PR migrates regions storage from UserDefaults to FileManager. Same file structure followed as mentioned in issue description.
fixes issue: #629
Code Changes
- Created
FileManagerProtocol
to abstract FileManager operations for testability. - Updated RegionService to store and fetch defaultRegion and custom Regions in File system.
- Created
FileManagerMock
and updatedRegionsServiceTests
.
Thank you @aaryankotharii! I'll review and get back to you soon!
Hello @ualch9, I have made the following changes as requested above.
- replaced
PropertyListEncoder / Decoder
withJSONEncoder / Decoder
. - replaced enum
FileDestination
logic with simple static constants inRegionsService
. - renamed
FileManagerProtocol
toRegionsServiceFileManagerProtocol
.
Thank you @aaryankotharii! Apologies for the delayed turnaround in reviewing, I'll get to this ASAP.
no worries @ualch9, but there are a few migration issues I'm not sure how to address. for example, how to approach fetching custom regions, of existing users, which are stored in userdefaults ?
no worries @ualch9, but there are a few migration issues I'm not sure how to address. for example, how to approach fetching custom regions, of existing users, which are stored in userdefaults ?
Excellent question... @aaronbrethorst, do you have any insight on if custom regions are used enough for us to support a migration path?
I would not worry about custom regions at this time. Thanks for checking!
@aaryankotharii - need anything from me in order to get this wrapped up?