-
-
Notifications
You must be signed in to change notification settings - Fork 641
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
circularly reference on update #2001
Comments
Seems as a circular issue in the class definition of User as it extends a generic with itself as argument? |
the PlainMessage is only a helper to strip out the helper methods and description fields of the protobuf message The issue happens really only if the |
What is |
It is a wellknown type of The ts definition comes with the base package, most languages provide one for the wellknown types. Found here: The |
Please provide a repro |
@dfahlander Here is the repo to reproduce the issue https://github.com/Zetanova/dexie-issue-2001 |
Reorder overloaded update method so that if callback is provided TS at least do not care whether T is circular or not.
There's nothing we could do to support recursive types since the number of possible keypaths would be infinite. I wish we could fallback to What I could do at least is to change the declaration of the overloaded method Table.update() so that it won't complain about circular references if the callback version is used. Runtime, you could continue using the object overload though but you'd have to make TS compiler ignore the line with The provided repro compiles now at least but it's only using the callback overload. |
My typescript skill level is only medium and I don't really understand why the issue fully What I discovered is that a field with Some goes for Maybe the Compiler ignores are always a possibility I can workaround the issue over get/put |
Since this is a typing issue only, it's probably better to workaround the issue by disabling typechecking only for the line that does table.update(): // @ts-ignore
db.someTable.update(...) |
thx, is the best current option |
I get a tslint error when I try to use the following entity
This method call generates the error only if the
UserEntity.attributes
field is defined.add, put methods working fine and I could narrow the issue down to
attributes: { [key: string]: Value };
definition. But have now clue how to fix it.The text was updated successfully, but these errors were encountered: