Skip to content
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

Fix Widget Kit Refreshing Bug #778

Merged
merged 3 commits into from
Dec 10, 2024

Conversation

manu-r12
Copy link
Contributor

@manu-r12 manu-r12 commented Dec 9, 2024

Note:

The problem was that RestAPIServices wasn’t refreshing properly when changing to new region due to some reasons. I added a method, getRefreshedAPIService, to fix this issue efficiently FOR NOW :)

Preview:
e036f0c1d9b84114bce4c299642b8c0c.MP4

Copy link
Member

@aaronbrethorst aaronbrethorst left a comment

Choose a reason for hiding this comment

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

looks good! There's one change I'd like to see about how a new apiService object is constructed, but otherwise 🚀 .

Also, I'm not sure why the CI is failing. Tests are passing, so 🤷 . I'll get this merged once your change is in and we can worry about CI later.

@@ -129,6 +129,15 @@ open class CoreApplication: NSObject,
self.apiService = RESTAPIService(APIServiceConfiguration(baseURL: region.OBABaseURL, apiKey: config.apiKey, uuid: userUUID, appVersion: config.appVersion, regionIdentifier: region.regionIdentifier))
}

public func getNewRefreshedRESTAPIService() -> RESTAPIService? {
Copy link
Member

Choose a reason for hiding this comment

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

delete this

func loadData() async {
arrDepDic = [:]

guard let apiService = app.getNewRefreshedRESTAPIService() else {
Copy link
Member

Choose a reason for hiding this comment

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

call app.refreshServices() and then use app.apiService

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done ✅

Copy link
Member

@aaronbrethorst aaronbrethorst left a comment

Choose a reason for hiding this comment

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

great work 🚀

@aaronbrethorst aaronbrethorst merged commit 3f1bcb8 into OneBusAway:main Dec 10, 2024
1 of 2 checks passed
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