-
Notifications
You must be signed in to change notification settings - Fork 130
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
SQLite cache doesn't work #211
Comments
Apparently, it's a problem with SQLite.swift: I suppose there are two issues now:
|
Oh joy, the SQLite.swift cocoapod hasn't been updated in nearly a year. I added this to my podfile to force download the latest: pod 'SQLite.swift', :git => 'https://github.com/stephencelis/SQLite.swift', :branch => 'master' I'm still trying to verify that the latest version fixes the bug and doesn't cause any new ones. |
Just to follow up... the above workaround fixed local caching for me. I'm still somewhat amazed that this wasn't brought up earlier. I'm guessing this is somehow unique to my setup. |
@airstance Haha, honestly I haven't brought it up because no one else brought it up and it seems like it would be a widespread issue, so I thought I just did something wrong. |
For what it's worth, the workaround posted above didn't fix the issue for me. I still get the Edit |
This issue has impacted our app. Cache stopped working. We didn't notice initially because we didn't test the offline usecase before last release. The workaround from @airstance above seems to work. |
Can someone Deny or confirm? |
Hi all, I'm investigating this issue today and will update when I have more info. If the update from @airstance is accurate, the fix might be as easy as just updating our SQLite dependency to point to the master branch instead of an officially tagged release. However, we'll need to review the changes to make sure there aren't any surprises laying in wait for us taking the latest release. |
I'm also having this problem! |
- Updated SQLite.swift to master branch instead of official release - Added unit tests for #211 - Fixed whitespace linting violations - Import AppSyncLogHelper instead of CocoaLumberjack in AppSync Objective-C classes - Added SQLite to TestCommon dependencies to allow for direct DB access for some setup unit tests - Updated AWS dependencies to 2.9.5 - Moved long-running performance tests to integration test suite to allow for rapid execution of unit tests during development
- Updated SQLite.swift to master branch instead of official release - Added unit tests for #211 - Fixed whitespace linting violations - Import AppSyncLogHelper instead of CocoaLumberjack in AppSync Objective-C classes - Added SQLite to TestCommon dependencies to allow for direct DB access for some setup unit tests - Updated AWS dependencies to 2.9.5 - Moved long-running performance tests to integration test suite to allow for rapid execution of unit tests during development
- Updated SQLite.swift to specific master branch commit instead of official tagged release - Added unit tests for #211 - Fixed whitespace linting violations - Import AppSyncLogHelper instead of CocoaLumberjack in AppSync Objective-C classes - Added SQLite to TestCommon dependencies to allow for direct DB access for some setup unit tests - Updated AWS dependencies to 2.9.5 - Moved long-running performance tests to integration test suite to allow for rapid execution of unit tests during development
- Updated SQLite.swift to specific master branch commit instead of official tagged release - Added unit tests for #211 - Fixed whitespace linting violations - Import AppSyncLogHelper instead of CocoaLumberjack in AppSync Objective-C classes - Added SQLite to TestCommon dependencies to allow for direct DB access for some setup unit tests - Updated AWS dependencies to 2.9.5 - Moved long-running performance tests to integration test suite to allow for rapid execution of unit tests during development
What this boils down to is, as @airstance pointed out, a bug in SQLite.swift. Xcode 10.2 changed the behavior of the The bug is fixed in the master branch of the SQLite.swift package, but they haven't done a release with the fix yet. We attempted to work around this by pinning our dependency to the appropriate commit in the Our options are all sort of unpalatable at this point:
We're conferring to see which way we want to go. At this point I'm leaning toward Option 1, since it's the one that fixes the bug fastest with the least likelihood of impact. My guess is that the number of customers using AppSync and also relying on SQLite is probably relatively small compared to the number who would be impacted by Option 2, and the increasing number of people who would be impacted by the bug and therefore having to wait if we go with Option 3. |
It looks like SQLite.swift has released an 0.11.6 tag to their repo, but not yet published it to the CocoaPods master spec repository. We're investigating setting up a dedicated spec repo as part of our source tree to get this fixed ASAP for AppSync. |
well. For me is still not working =T |
If you use cocoa pods - you can try add to pod file line : "pod 'SQLite.swift', :git => 'https://github.com/stephencelis/SQLite.swift', :branch => 'master' |
Actually this works for me =)... |
@adolffre There isn't a new version of AppSync that consumes the SQLite.swift 0.11.6 version yet. However, I do see that the CocoaPods trunk is updated with 0.11.6. I'm testing those changes locally and hope to have the new version pushed later today. @albertchubakov Rather than |
I've confirmed that we can pull in SQLite.swift 0.11.6. Technically, this will be a breaking change, as AppSync must now be built using Xcode 10.2 or later even though we are maintaining our Swift version as 4.2.1. However, the fix is only necessary for folks building on Xcode 10.2 anyway, so it seems like a good tradeoff, letting customers who don't currently build on Xcode 10.2 migrate. |
This is fixed in 2.12.0. Please let us know if you continue to see problems. |
This issue has been automatically closed because of inactivity. Please open a new issue if are still encountering problems. |
Describe the bug
When I initialize an AWSAppSyncClient object, I'm getting SQLite errors after it creates the initial table.
To Reproduce
Steps to reproduce the behavior:
Environment(please complete the following information):
Device Information (please complete the following information):
Additional context
this line in AWSSQLLiteNormalizedCache.swift is throwing an error:
71 let recordCount = try db.scalar(queryRootRecords.count)
2019-03-31 07:46:10.896731-0700 Trips[3429:79351] [logging] unrecognized token: ":"
(SQLite.Result) $E7 = error {
error = {
message = "unrecognized token: ":""
code = 1
statement = nil
}
}
It seems to be building an odd request for SQLite:
(SQLite.ScalarQuery) $R4 = {
clauses = {
select = {
distinct = false
columns = 1 value {
[0] = {
template = "count(_:)(*)"
bindings = 0 values {}
}
}
}
from = {
name = "records"
alias = nil
database = nil
}
join = 0 values {}
filters = some {
template = "("key" = ?)"
bindings = 1 value {
[0] = "QUERY_ROOT"
}
}
group = nil
order = 0 values {}
limit = nil
union = 0 values {}
}
}
The text was updated successfully, but these errors were encountered: