jfecher / jfecher/inc-complete

`Accumulated` computation impl uses constant `computation_id` which may conflict with other ids

Open
#12 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
17
Forks
3
PR merge metrics
No merged PRs in 30d

Description

`Accumulated` currently implements `Computation` and `Run` itself for users, using a hard-coded computation id:
https://github.com/jfecher/inc-complete/blob/master/src/accumulate.rs#L74
```rs
fn computation_id() -> u32 {
100000
}
```
If the user's computations use this ID - or even if they have more than one accumulated type in their Db this will break.

This should be fixed such that:
1. `Accumulated::::computation_id() != Accumulated::::computation_id()` for `A != B`
2. `Accumulated::
::computation_id()` does not conflict with user ids or requires users to assign it an id

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in src/accumulate.rs at the Computation implementation around line 74, then inspect how computation IDs are assigned and checked for Db users. Define a collision-free approach that gives different Accumulated types distinct IDs without conflicting with user IDs, and verify both stated requirements with tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.