-
Notifications
You must be signed in to change notification settings - Fork 37
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: subscriptions with wildcard pattern matching #1152
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
PR Reviewer Guide 🔍
|
PR Code Suggestions ✨
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pull request introduces a temporary fix for subscriptions with wildcard pattern matching. The changes look good and should improve the functionality of the getSyncEntities
call. However, it's important to remember that this is a temporary solution and should be revisited when upgrading to dojo-1.0-alpha.5. The code is clean and well-formatted, which is appreciated. Consider adding a TODO comment to remind about the future removal of this fix, and possibly review if the 'VariableLen' pattern matching is the most efficient for your use case.
Thanks for using MentatBot. Give comments a 👍 or 👎 to help me improve!
@@ -14,7 +14,20 @@ export async function setup({ ...config }: DojoConfig) { | |||
const updates = await createUpdates(); | |||
|
|||
// fetch all existing entities from torii | |||
const sync = await getSyncEntities(network.toriiClient, network.contractComponents as any, [], 1000); | |||
const sync = await getSyncEntities( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change improves the getSyncEntities
call by adding a specific configuration for key pattern matching. It's a good temporary fix, but as mentioned in the PR description, it should be removed when upgrading to dojo-1.0-alpha.5. Consider adding a TODO comment to remind about this future change.
network.contractComponents as any, | ||
[ | ||
{ | ||
Keys: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pattern_matching: "VariableLen"
setting allows for more flexible entity querying. However, it might be worth considering if this is the most efficient approach for your specific use case. If you know the exact structure of your entities, a more specific pattern might be more performant.
User description
Nasr helped us by giving us this quick fix. We can remove this when we switch to dojo-1.0-alpha.5
PR Type
Bug fix
Description
client/src/dojo/setup.ts
for better organization.getSyncEntities
call to include wildcard pattern matching.getSyncEntities
function to support pattern matching withVariableLen
.Changes walkthrough 📝
setup.ts
Fix wildcard pattern matching in subscriptions setup
client/src/dojo/setup.ts
getSyncEntities
call to include wildcard pattern matching.getSyncEntities
.