Skip to content

Conversation

@ubik2
Copy link
Contributor

@ubik2 ubik2 commented Sep 25, 2025

Summary by cubic

Removed Replica.push and updated Provider.send to build facts and commit directly. This unifies the write path and removes redundant push logic.

  • Refactors
    • Deleted Replica.push; transactions now commit directly.
    • Provider.send assembles assert/retract facts (including cause) and calls workspace.commit.
    • Retracts when values/labels are cleared; no-op when no writes.
    • send is primarily for tests/tools.

@ubik2 ubik2 merged commit 0fdd1a8 into robin/subscription-performance Sep 25, 2025
@ubik2 ubik2 deleted the robin/remove-replica-push branch September 25, 2025 21:32
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="packages/runner/src/storage/cache.ts">

<violation number="1" location="packages/runner/src/storage/cache.ts:1743">
Unreachable else branch due to duplicated condition, leaving dead code for label retraction.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

}));
} else {
changes.push({ of: uri, the: LABEL_TYPE });
facts.push(retract(currentLabel as Consumer.Assertion));
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Sep 25, 2025

Choose a reason for hiding this comment

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

Unreachable else branch due to duplicated condition, leaving dead code for label retraction.

Prompt for AI agents
Address the following comment on packages/runner/src/storage/cache.ts at line 1743:

<comment>Unreachable else branch due to duplicated condition, leaving dead code for label retraction.</comment>

<file context>
@@ -1790,29 +1717,37 @@ export class Provider implements IStorageProvider {
+            }));
           } else {
-            changes.push({ of: uri, the: LABEL_TYPE });
+            facts.push(retract(currentLabel as Consumer.Assertion));
           }
         }
</file context>
Fix with Cubic

ubik2 added a commit that referenced this pull request Sep 25, 2025
* Don't check subscriptions with read only transactions
Some cleanup to avoid some of our complex nested classes.

* Add a flag to Replica.push so that by default, we don't push transactions that are only Claims.

* Alter transaction to prevent commit of nothing but claims.
Add comment to Replica.push to note that we generally bypass that now (still used in tests and curl).

* Remove Replica.push and change Provider.send to directly commit instead. (#1827)
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