clockworklabs / clockworklabs/SpacetimeDB
C# SDK. If I subscribe to changes via a View, updates to rows trigger OnInsert + OnDelete instead of OnUpdate
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 25.2k
- Forks
- 1.1k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 46
Description
I have a public table and a view like that:
[View(Accessor = "MyHeroes", Public = true)]
public static IQuery<Hero> MyHeroes(ViewContext ctx)
{
return ctx.From.Hero().Where(h => h.Owner.Eq(ctx.Sender));
}
If I subscribe to the public table and update the row, I receive OnUpdate callback.
If I subscribe to the view and update the row, I receive OnInsert + OnDelete callbacks.
Here is how it looks in the logs:
- [14:13:59] Create an entry.
- [14:14:07] Update it.
Any ideas why subscribing to a View behaves differently from subscribing to a public table?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the C# SDK subscription handling for the shown MyHeroes view and compare it with the public-table subscription path. Reproduce the create-then-update sequence from the issue and inspect the callback logs. Done means updating a row through a subscribed view produces OnUpdate rather than OnInsert plus OnDelete.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100