Title: Query result during transaction will be blank if there's already a query with a similar "group" defined. · Issue #259 · tinyplex/tinybase · GitHub
Open Graph Title: Query result during transaction will be blank if there's already a query with a similar "group" defined. · Issue #259 · tinyplex/tinybase
X Title: Query result during transaction will be blank if there's already a query with a similar "group" defined. · Issue #259 · tinyplex/tinybase
Description: Describe the bug In a pretty specific situation, a query result will return BLANK during a transaction. You can see it in the code below (and in the linked stackblitz). To reproduce: define a first query with a group keyword. start a tra...
Open Graph Description: Describe the bug In a pretty specific situation, a query result will return BLANK during a transaction. You can see it in the code below (and in the linked stackblitz). To reproduce: define a first...
X Description: Describe the bug In a pretty specific situation, a query result will return BLANK during a transaction. You can see it in the code below (and in the linked stackblitz). To reproduce: define a first...
Opengraph URL: https://github.com/tinyplex/tinybase/issues/259
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Query result during transaction will be blank if there's already a query with a similar \"group\" defined.","articleBody":"### Describe the bug\n\nIn a pretty specific situation, a query result will return BLANK during a transaction. You can see it in the code below (and in the linked stackblitz).\n\nTo reproduce:\n- define a first query with a group keyword.\n- start a transaction\n- define another query (on the same table) with a group keyword (can be a different column!)\n- call `getResultTable` and see that it's blank\n- finish the transaction\n- call `getResultTable` and see that it does return a value\n\nSee the following code (and linked reproduction).\n\n```ts\nconst store = createMergeableStore().setSchema(\n\t{\n\t\trecords: {\n\t\t\taccount: { type: 'string' },\n\t\t\tamount: { type: 'number' },\n\t\t\tdecimals: { type: 'number' },\n\t\t},\n\t},\n\t{}\n);\nstore.setTables({\n\trecords: generateDummyData(),\n});\n\nconst queries = createQueries(store);\n\nqueries.setQueryDefinition('budgetTotal', 'records', (keywords) =\u003e {\n\tkeywords.select('account');\n\tkeywords.select('amount');\n\t// if you comment out the group line here, the second query will work correctly.\n\tkeywords.group('amount', 'avg');\n});\n\nif (enableTransaction) {\n\tstore.startTransaction();\n}\n\nconst queryId = `otherQuery`;\nqueries.setQueryDefinition(queryId, 'records', (keywords) =\u003e {\n\tkeywords.select('amount');\n\tkeywords.where('account', '1');\n\t// or if you remove group here, this query will work correctly.\n\t// also has issues if you group by a completely different column\n\tkeywords.group('amount', 'sum');\n});\n\nconsole.log('first', JSON.stringify(queries.getResultTable(queryId))); // BLANK!\nconsole.log('second', JSON.stringify(queries.getResultTable(queryId))); // BLANK!\n\nif (enableTransaction) {\n\tstore.finishTransaction();\n\tconsole.log(\n\t\t'after transaction',\n\t\tJSON.stringify(queries.getResultTable(queryId))\n\t);\n}\n```\n\n### Your Example Website or App\n\nhttps://stackblitz.com/edit/vitejs-vite-jec8c4bm?file=src%2Fcounter.ts\n\n### Expected behavior\n\nI would expect the query to return correct data, even mid-transaction.\n\n### Platform\n\n- OS: macOS\n- Browser: Brave\n- Version: 6.3","author":{"url":"https://github.com/willhoney7","@type":"Person","name":"willhoney7"},"datePublished":"2025-07-08T03:03:59.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/259/tinybase/issues/259"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a6d16f0b-6db2-10d8-7a0e-7b1f010696e6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9B2E:86A36:A7648D:F0A39C:6A4E456A |
| html-safe-nonce | 62c66533a9ea181b38057d78011e3927cca6ce483ce9740d7b83554033770afd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QjJFOjg2QTM2OkE3NjQ4RDpGMEEzOUM6NkE0RTQ1NkEiLCJ2aXNpdG9yX2lkIjoiMTI4OTIxNjc0NDQzMTE3NTAxOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4f9ef35fdacbb7175ccf15b2d0dfc973cd60fb88f0a8621e2d45ba421cb54f78 |
| hovercard-subject-tag | issue:3210854707 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/tinyplex/tinybase/259/issue_layout |
| twitter:image | https://opengraph.githubassets.com/16d3108e5bf5a617434adea2167b0c01146b5b0c693b111d22cfade264a52f65/tinyplex/tinybase/issues/259 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/16d3108e5bf5a617434adea2167b0c01146b5b0c693b111d22cfade264a52f65/tinyplex/tinybase/issues/259 |
| og:image:alt | Describe the bug In a pretty specific situation, a query result will return BLANK during a transaction. You can see it in the code below (and in the linked stackblitz). To reproduce: define a first... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | willhoney7 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0 |
| turbo-cache-control | no-preview |
| go-import | github.com/tinyplex/tinybase git https://github.com/tinyplex/tinybase.git |
| octolytics-dimension-user_id | 96894742 |
| octolytics-dimension-user_login | tinyplex |
| octolytics-dimension-repository_id | 443220240 |
| octolytics-dimension-repository_nwo | tinyplex/tinybase |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 443220240 |
| octolytics-dimension-repository_network_root_nwo | tinyplex/tinybase |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9fabff9b8b127e686a3ec86f91422e818056ca2c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width