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

[SQLNormalizedCache] fix watcher not called on initial cache write #2538

Merged
merged 5 commits into from
Aug 26, 2020

Conversation

martinbonnin
Copy link
Contributor

When no record was present in the cache, return all changed keys.

fixes #2537

Copy link
Contributor

@sav007 sav007 left a comment

Choose a reason for hiding this comment

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

Should we have test for this?

@martinbonnin
Copy link
Contributor Author

Should we have test for this?

Yes, 100%! I'll add one.

@@ -11,6 +11,7 @@ dependencies {
add("implementation", "com.apollographql.apollo:apollo-rx3-support")
add("implementation", "com.apollographql.apollo:apollo-coroutines-support")
add("implementation", "com.apollographql.apollo:apollo-http-cache")
add("implementation", "com.apollographql.apollo:apollo-normalized-cache-sqlite")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's nice to be able to test the SqliteCache without Android 😃

Copy link
Contributor

Choose a reason for hiding this comment

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

Definitely. It's a big win.

Copy link
Contributor

@tasomaniac tasomaniac left a comment

Choose a reason for hiding this comment

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

Awesome tests.

@martinbonnin martinbonnin merged commit 9eae05f into master Aug 26, 2020
@martinbonnin martinbonnin deleted the bug-2537/watcher-not-called branch August 26, 2020 17:02
martinbonnin added a commit that referenced this pull request Sep 16, 2020
* [SQLNormalizedCache] fix watcher not called on initial cache write (#2538)

* when no record was present in the cache, return all changed keys

* add a unit test

* add an integration test

* wait for the second resposne

* remove debug

* Update dependency gatsby-theme-apollo-docs to v4.3.10

* [Compiler] fix optional Int properties with an uppercase name (#2543)

* use the field name for class properties, not the schema name

fixes #2541

* add built in introspection types to SDL parser

Also:
- remove leading whitespace in block strings
- remove leading trailing quotes when parsing String default values

* normalize Json numbers, GraphQL Ints and Floats to Kotlin Double

* use SDL schemas for codegen tests

* update test fixtures

* move the SDL definitions to a separate file

* Bump kotlin compile testing (#2547)

* bump kotlin compile testing

* enable warnings again

* [Plugin] allow running the plugin on Gradle 5.6 (#2539)

* add skipGradleVersionCheck

* rename to relaxGradleVersionCheck

* remove doc

* remove the Gradle 6 mention. It turns out Gradle 5.6 should work fine
given that the poms reference the jvm projects

* update metalava

* allow 5.6 more globally

* Minor doc edits (#2548)

* fix a bad copy/paste in the doc and take this opportunity to add more
doc about the structure of generated models

* add the apollo icon to the .idea folder

* add spaces before and after the MultiCodeBlocks

* Update dependency gatsby-theme-apollo-docs to v4.4.1

* Update dependency gatsby-theme-apollo-docs to v4.4.2

* Update dependency gatsby to v2.24.52

* Put the location of the .xcodeproj file for Kotlin Multiplatform Mobile integration in Android Studio (#2554)

* compile Kotlin against stdlib 1.3 (#2555)

See https://issuetracker.google.com/issues/166582569

* Update dependency gatsby-theme-apollo-docs to v4.4.3

* Update dependency gatsby to v2.24.53

* Update mutations.mdx (#2561)

* bump sql delight version (#2564)

* Multi-module support (#2514)

* First drop for multi-module support

* update metalava

* add alwaysGenerateTypesMatching and a few unit tests

* added some tests

* minor tweaks

* update metalava

* stay on Gradle 6.0

* add more gradle tests

* wip

* wip

* better place to put the workaround

* add experimental markers

* remove some references to zip

* fix test

* add a test for diamond-shaped dependencies

* work in progress on a duplicates task

* add more tests

* fix tests

* remove debug

* typo

* in the compiler module, use 'metadata' instead of 'multi-module'

* added a few comments

* fix tests

* make Service and Variant public

* update metalava

* [Sdl] Fix a scalar definition after a union defintion (#2559)

* modify the test case to make it fail

* give more context if an error heppens during `toIntrospectionSchema`

* fix the union possible types were eating the following scalar
definitions

* bump Kotlin version (#2568)

* Update dependency gatsby to v2.24.57

* Remove toDeferred in favor of await. (#2574)

Closes #2571

* Bump Kotlin to 1.4.10 (#2578)

* Add a link to the Kotlin slack (#2576)

* add Kotlin as language for the codeblock (#2580)

* make compile

* make it compile

* fixes

* make CodegenTests pass

* fix some tests

* fix some more tests

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Said Tahsin Dane <taso.dane@deliveryhero.com>
Co-authored-by: Jagdeep Nagpal <jagdeepnagpal@gmail.com>
Co-authored-by: Ahmed I. Khalil <ahmedibrahimkhali@gmail.com>
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.

Query watcher with SQLNormalizedCache not triggering updates
3 participants