-
-
Notifications
You must be signed in to change notification settings - Fork 44
Description
Describe the bug
The "future earnings" page has been hidden on the live site because the substantial functionality is not quite ready. We load a open source C++ WebAssembly module and we interface with it using the Pia file format we produce from the user input. For the simpler input (birthdate, earnings, pension) the file format works well. But when we have to also specify assumptions about the future, it throws an error cryptically #234
Maybe we are passing in a line of conflicting information somehow in the file format we are generating, or we are passing in too much information.
The root of the issue is the code block after this line:
https://github.com/codeforboston/windfall-elimination/blob/develop/src/library/pia/index.ts#L101
To Reproduce
Steps to reproduce the behavior:
- run the app with
GATSBY_SHOW_FUTURE_EARNINGS_PAGE=true npm startto enable the feature toggle. Lowercase true is important. - Put in a birthdate that is not past their 70th birthday (e.g. not from year 1943 ... 1957 is good.) The assumptions sections at issue is only relevant if the person may be yet to retire.
- Load the https://www.dropbox.com/s/7y55twj8c1dfs1j/Windfall_App_Sample_20.xml?raw=1&dl=1 (downloadable from front/home page) into the earnings page
- Continue to the "future earnings" page which should have appeared if you followed step 1.
- Choose use percentage only. Provide 0.01 percent.
- Open your developer tools
- Continue to the results page
Expected behavior
Change the birth date to 1943 to see the basic correct behavior for the same input. The results page provides a value for the detailed calculator that is distinct from the windfall calculator.
Screenshots
Windfall Awareness calculator value

Detailed calculator failed to produce a value (it did not update, see error in devtools at right)

Additional context
I believe we can troubleshoot this issue in 2 ways.
a. The first way is to make 5-20 copies of piaFormat at https://github.com/codeforboston/windfall-elimination/blob/develop/src/library/pia/index.ts#L101.
b. each copy should have slightly different values put into that copy using its setter functions. These can take inspiration using different subsets and modifications from the existing values that are currently hard coded.
c. then pass each of them into the line where the WASM module crashes (https://github.com/codeforboston/windfall-elimination/blob/develop/src/library/pia/index.ts#L146). If one of them succeeds without the Uncaught (in promise) 5399408 - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch. then we make note of it and we can start troubleshooting.
- I have not yet made a build of AnyPIAJS with
DISABLE_EXCEPTION_CATCHING=2but I may try to do that too. This might show a more helpful error.
Thank you @alexjcode for help writing this up!