Hi again. I still don’t know what could cause this error message.
So, the question is not what is causing it in this specific case (i.e. in my code), I would be more than happy with only some kind of explanation of what things generally cause this error message.
I think it could be quite helpful with that help only; i.e. to get an explanation of what kind of troubles you see could cause the error message. From there I can analyze my program to see if any such condition seem to be met. I might be able to identify the problem based on your description of how you have previously seen it occur.
If you think there are too many possible conditions, and want it more narrowed down to say anything, I have set up a small project (VS2017) which uses only the minimum necessary code to reproduce the error, it can be found here: https://github.com/oetyng/SAFE.BugRepro
You can see that I already generated the encodedUrl, so it is to be pasted into the string on line 19 in class ReproErrorTest. Yes, this will log you in to my account on the live alpha 2 network, I figured I would try make it as easy as possible to help me here. So, this is the string:
So, you can just debug the method TestPermissionSet in class ReproErrorTest.cs, and step right through to line 42 in TestClass.cs. That is all that is necessary to see it in action.
Also provided, some of the points from this post: https://forum.safedev.org/t/in-need-of-support-please-follow-these-guidelines/1271:
Basic info as per the support questions template
- What application or program are you running?
SAFE.EventStore (or for your convenience SAFE.BugRepro), based on SafeMessages
It uses https://github.com/oetyng/safe_dotnet (included in SAFE.BugRepro) which is a .NET wrapper around the FFI libraries that I wrote.
I compiled safe_app and system_uri from alpha_2 branch.
SafeBrowser v0.6.0 for authorising app and getting encoded url.
- What’s the version number?
- What are the version numbers of the supporting dependencies that you are using locally? For example, Node.js, NPM, and Rust.
- Which operating system are you using and which version number?
Windows 10 Education in a Hyper-V VM (Microsoft Windows NT 6.2.9200.0)
- What steps did you follow when the error occurred and how can we reproduce it?
Basically I am running the same base code as SafeMessages, albeit extracted out and placed within another app.
The test project SAFE.BugRepro has extracted out what happens in the original project SAFE.EventStore.
I register the uri with SystemUri which I compiled from alpha_2 branch. Then I get an EncodedUrl from SafeBrowser (which is sent as argument to the application on the path I specified in AppInfo Exec property when installing the Uri).
There, the EncodedUrl is passed to
HandleUrlActivationAsync of AppSession.cs, (it is the same code as in SafeMessages).
AppRegisteredAsync is called in class Session.cs, (containing exactly the same code as in SafeMessages).
There it calls
NativeBindings.AppRegistered(appId, authGrantedFfiPtr, NetObs, callback);
(which is also the exact same code, copied).
After this, I try to do the very first operation, which is to do the equivalent of what is done here:
This is done on line 42 in TestClass.cs, here:
And this is where the problem occurs (as per OP).
Q: Could someone please provide me with any information on what might be going wrong here?
Specifically, under what circumstances can this error
"Invalid MutableData permission set handle" occur?
Or please let me know what more info I can give you so that you can help me out.