Clean up schema discovery and add Principal in TS SDK#2608
Conversation
|
There are other bugs which is already fixed. The main one was #2613 . the last two things spotted is:
|
| } | ||
| } | ||
|
|
||
| return vars; |
There was a problem hiding this comment.
Not sure why this is showing, all files in http should have been a file renaming.
There was a problem hiding this comment.
It was getting overly complicated, hence refactored the code along with re-organisation
|
1 more integration test failure to fix which is async funOptionalQMark(param1: string, param2?: number, param3?: string) {
return self.barAgent(param1, param2, param3)
}After auto injection, the RPC is failing for these question mark parameters. |
| switch (elem.tag) { | ||
| case 'unstructured-text': | ||
| const parameterDetail = paramTypes[idx]; | ||
| paramTypes.map((parameterDetail) => { |
There was a problem hiding this comment.
we mapped data value elements before. This time we are mapping parameter types and then lookup data value elements. This is an important change to get errors
|
While adding support of principal, i made a lot of cleanups. While certain parts was just code moving aaround, certain other parts mainy schema module was heavily refactored. And then it was much easier to add support for Principal. Also note that, I couldn't do all cleaning (certain bits within schema module too, and some code that you see was just code moved around and might still look to be something that can be improved). Allow me to do follow ups for that, because it took a lot of time for me to figure out how i broke integration tests - to finally - make it green. https://github.com/golemcloud/golem/actions?query=is%3Afailure+branch%3Afeature_2551 , and finally it is green. |
| // Deserializing rpc result doesn't require principal context, | ||
| // In this case typeInfoInternal is 'unstructured-text', so Principal type cannot appear here | ||
| ], | ||
| { tag: 'anonymous' }, |
There was a problem hiding this comment.
We can do something about it - to be more clearer. but I have already done a lot of cleanups elsewhere to avoid these kind of situations to add Principal feature, and can clean ups in follow up PR.
Fixes #2551
Fixes #2613
While adding support of principal, i made a lot of cleanups. While certain parts was just code moving aaround, certain other parts mainy
schemamodule was heavily refactored. And then it was much easier to add support for Principal.Also note that, I couldn't do all cleaning (so certain code that was moved around might still look to be something that can be improved). Allow me to do follow ups for that, because it took a lot of time for me to figure out how i broke integration tests: https://github.com/golemcloud/golem/actions?query=is%3Afailure+branch%3Afeature_2551 , and finally it is green.
Apart from the whole schema module being refactored, the following specific clean ups was done.
schemapackage and separate out functions that's dedicated to constructor, method input and method output.httpmodule insideinternal.