Skip to content
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

commitlint: footer-refs-validity bug #148

Closed
knocte opened this issue Jan 16, 2024 · 0 comments · Fixed by #152
Closed

commitlint: footer-refs-validity bug #148

knocte opened this issue Jan 16, 2024 · 0 comments · Fixed by #152

Comments

@knocte
Copy link
Member

knocte commented Jan 16, 2024

False positive:

Backend(,Tests): don't marshall hybrid type names

This is the 1st part (out of three) to fix bug 242: in certain
circumstances, the call to Type.GetType(fullTypeName) was
returning null (and then causing an NRE like the stacktrace in
bug 242 proves) or a FileLoadException [3].

It turns out that .NET's BCL, despite having separate
properties for the Type names "FullName" vs
"AssemblyQualifiedName", the first one still adds assembly
qualified names to types that are part of a generic type
definition. I.e., it will not add them in a type such as
"System.String" but it will in one such as "List<String>"
(see [1]):

` ` `
"System.Collections.Generic.List`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c5619[34](https://github.com/nblockchain/geewallet/actions/runs/7526526463/job/20485327146#step:7:35)e089]]
` ` `

This could be dangerous because it would embed the version
number (even though we already have a JSON field for that in
our MarshallingWrapper type, which could make the type be not
found by Type.GetType (and as a consequence return null, or
throw the exception mentioned before).

The fix, or rather workaround, here, is to use ToString()
instead of the .FullName property, as hinted by this S.O.
answer: [2].

[1] https://learn.microsoft.com/en-us/dotnet/api/system.type.fullname
[2] https://stackoverflow.com/a/4662878/23158491
[3] Stack trace:
` ` `
System.IO.FileLoadException: Could not load file or assembly 'GWallet.Backend, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. The located assembly's manifest definition does not match the assembly reference. (0x80131040)
File name: 'GWallet.Backend, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, StackCrawlMarkHandle stackMark, ObjectHandleOnStack assemblyLoadContext, ObjectHandleOnStack type, ObjectHandleOnStack keepalive)
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, StackCrawlMark& stackMark, AssemblyLoadContext assemblyLoadContext)
   at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, StackCrawlMark& stackMark)
   at System.Type.GetType(String typeName)
   at GWallet.Backend.Marshalling.ExtractType(String json) in /Users/knocte/Documents/Code/geewalletSTABLE/src/GWallet.Backend/Marshalling.fs:line 156
   at GWallet.Backend.Account.ImportSignedTransactionFromJson(String jsonOrCompressedJson) in /Users/knocte/Documents/Code/geewalletSTABLE/src/GWallet.Backend/Account.fs:line 713
   at GWallet.Backend.Account.LoadSignedTransactionFromFile(String filePath) in /Users/knocte/Documents/Code/geewalletSTABLE/src/GWallet.Backend/Account.fs:line 766
   at Program.BroadcastPayment() in /Users/knocte/Documents/Code/geewalletSTABLE/src/GWallet.Frontend.Console/Program.fs:line 62
   at Program.PerformOperation(UInt32 numActiveAccounts, UInt32 numHotAccounts) in /Users/knocte/Documents/Code/geewalletSTABLE/src/GWallet.Frontend.Console/Program.fs:line [39](https://github.com/nblockchain/geewallet/actions/runs/7526526463/job/20485327146#step:7:40)8
   at Program.ProgramMainLoop[a]() in /Users/knocte/Documents/Code/geewalletSTABLE/src/GWallet.Frontend.Console/Program.fs:line [47](https://github.com/nblockchain/geewallet/actions/runs/7526526463/job/20485327146#step:7:48)8
   at Program.NormalStartWithNoParameters() in /Users/knocte/Documents/Code/geewalletSTABLE/src/GWallet.Frontend.Console/Program.fs:line [49](https://github.com/nblockchain/geewallet/actions/runs/7526526463/job/20485327146#step:7:50)0
` ` `
Mersho added a commit to Mersho/conventions that referenced this issue Jan 30, 2024
This commit rectifies a problem in the removeAllCodeBlocks
function that was unintentionally deleting all text between two
code blocks. The modification guarantees that only the code
blocks are substituted, leaving the remaining text unaffected.

Fixes nblockchain#148
Mersho added a commit to Mersho/conventions that referenced this issue Jan 30, 2024
This commit rectifies a problem in the removeAllCodeBlocks
function that was unintentionally deleting all text between two
code blocks. The modification guarantees that only the code
blocks are substituted, leaving the remaining text unaffected.

Fixes nblockchain#148
Mersho added a commit to Mersho/conventions that referenced this issue Jan 30, 2024
This commit rectifies a problem in the removeAllCodeBlocks
function that was unintentionally deleting all text between two
code blocks. The modification guarantees that only the code
blocks are substituted, leaving the remaining text unaffected.

Fixes nblockchain#148
Mersho added a commit to Mersho/conventions that referenced this issue Jan 30, 2024
This commit rectifies a problem in the removeAllCodeBlocks
function that was unintentionally deleting all text between two
code blocks. The modification guarantees that only the code
blocks are substituted, leaving the remaining text unaffected.

Fixes nblockchain#148
Mersho added a commit to Mersho/conventions that referenced this issue Jan 30, 2024
This commit rectifies a problem in the removeAllCodeBlocks
function that was unintentionally deleting all text between two
code blocks. The modification guarantees that only the code
blocks are substituted, leaving the remaining text unaffected.

Fixes nblockchain#148
Mersho added a commit to Mersho/conventions that referenced this issue Jan 30, 2024
This commit rectifies a problem in the removeAllCodeBlocks
function that was unintentionally deleting all text between two
code blocks. The modification guarantees that only the code
blocks are substituted, leaving the remaining text unaffected.

Fixes nblockchain#148
knocte added a commit that referenced this issue Jan 30, 2024
This change rectifies a problem in the removeAllCodeBlocks
function that was unintentionally deleting all text between two
code blocks. The modification guarantees that only the code
blocks are substituted, leaving the remaining text unaffected.

Fixes #148
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant