As mentioned in my previous post, there were a couple of issues I had to resolve to release the initial version of Blurtkey.
My objective/goal for this app is to release its initial version to Google Play. I still have a couple of items I need to resolve before releasing it's initial version. Particularly items #2 and #3 below.
- No loading indication after clicking import in the account import > page (no indication or feedback to user that import is processing)
- Forever loading icon on wallet page (latest wallet transaction not retrieved)
- Wallet operations are not working
- Delegate
For this update, I'm sharing how I was able to resolve item #2 above.
Forever loading icon on wallet page (latest wallet transaction not retrieved)
P.S.
We're in a holiday right now, as such, I am able to provide these frequent updates. When holidays are over, my updates will be infrequent.
1. Background
When trying to resolve issues, one of the most important step is diagnosing the problem and identifying the root cause. Because of the cognitive load I had to dedicate to work, I didn't have the capacity to consciously think of ways to troubleshoot and find out the root cause as early as I want.
2. Troubleshooting (aka Debugging)
The first step I had to make was identify the possible lines of codes that was causing the issue. I've already identified beforehand that the problem occurs in the Transactions
component. It had to do with fetching the transactions.
Next, I've identified that the problem was happening inside the initAccountTransactions
and fetchAccountTransactions
actions. The previous change (renaming hive to blurt) helped me in identifying this location. I've identified that getting an account's transactions was happening in the getAccountTransactions
method. It had this block of code.
const transactions = await getClient().database.getAccountHistory(
accountName,
start || -1,
start ? Math.min(10, start) : 1000,
operationsBitmask,
);
I've identified that the error was happening in this block of code by placing console logs before and after this block. I enclosed it in a try-catch
statement and logged the error.
The enclosing try-catch
gave me this following error which gave me the hint as to what was causing the problem.
RPCError: args.size() == 3: Expected #s argument(s), was 5
At first, I was really not sure what the error was saying since I was expecting that the library I was using was working. But eventually, it led to the conclusion that the problem was indeed in the library I was using - dblurt
.
3. The Solution
Since I don't have access to the official dblurt
library, I cloned the codes from blurt's repo, made my changes there, and published it as a scoped npm package.
This is an important step because time is of the essence when troubleshooting or debugging issues. It's important to not lose momentum.
The interim solution was this block of code:
public getAccountHistory(
account: string,
from: number,
limit: number,
operation_bitmask?: [number, number]
): Promise<[[number, AppliedOperation]]> {
let params = [account, from, limit]
/*
if (operation_bitmask && Array.isArray(operation_bitmask)) {
if (operation_bitmask.length !== 2) {
throw Error(
'operation_bitmask should be generated by the helper function'
)
}
params = params.concat(operation_bitmask)
}
*/
console.log("this.call('get_account_history', params)", params)
return this.call('get_account_history', params)
}
I commented out the portion where it adds to the params[]
array the operation_bitmask
. The error I logged from the previous section gave me the confidence that it will solve the problem since the operation_bitmask
is what gets added to the paramaters. params[]
has an initial size of 3 (account
, from
, and limit
), but adding operation_bitmask
increases the size of the array which resulted to the error.
RPCError: args.size() == 3: Expected #s argument(s), was 5
4. Key Take-aways
Overall, this is how I troubleshoot issues.
- Identify which block of code causes the error
- Output the specific error that the lines of code output (this is where the importance of libraries spitting out descriptive error messages)
- Try out solutions based on the error outputted
- Take a break if root cause cannot be immediately identified (taking more than two hours of continuous debugging).
5. Demo
Demo of the transactions loading successfully in the wallet page.
6. Codes
Code changes are available in Blurtopian's repository:
https://gitlab.com/blurtopian/blurtlibs/dblurt
7. NPM Package
https://www.npmjs.com/package/@blurtopian/dblurt
8. Next
My objective/goal for this app is to release its initial version to Google Play. I still have a couple of items I need to resolve before releasing it's initial version. Particularly items #2 and #3 below.
- No loading indication after clicking import in the account import page (no indication or feedback to user that import is processing)
Forever loading icon on wallet page (latest wallet transaction not retrieved)(Resolved)- Wallet operations are not working
- Delegate
@eastmael's Witness Projects
- Blurtkey the mobile Keychain version for Blurt (This Update)
- Blurt Wallet Modifications
- https://blurt-now.com/ to monitor your Blurt account
- @brunobot a Blurt Discord Bot notification service
- Blurt + Dtube Integration to simultaneously post your video on DTube and Blurt
- Blurt Richlist API in coordination with @ecosynthesizer's Blurt Richlist UI
- https://bi.blurt-now.com/ for your Blurt Business Intelligence data needs
- https://blurtopian.com @blurtopian #blurtopian Blurt contribution curation initiative
Find my contributions valuable? Please consider voting for my witness:
Really nice job!
It reflects your dedication to Blurt community.
I always appreciate your works because you do them in a nice way.
Hope your all upcoming jobs and works will occure in pleasing way.
Thanks a lot for this nice update!
Hopefully it goes well and can be published on Google Play soon. Amazing job.
From what country are you from? It's available in Google Play for open testing.
https://play.google.com/store/apps/details?id=com.blurtkey
It seems that it is still not accessible in the territory of Indonesia.
![Googleplay.jpg](https://imgp.blurt.world/768x0/https://img.blurt.world/blurtimage/djunmul/0cd7440eb5241bf784bd295c0926afbb182ac9df.jpg)
Thanks for the feedback. I've added all countries to open testing. Can you please try again?
Already accessible. The description has also been automatically translated into Indonesian. For now I'm trying to access it via a computer, later I'll try with a smartphone. Congratulations, this is a great achievement for Blurt.
Hello dear sir @eastmeal
You are doing a nice job.
New year has come.
2021 year bye! bye!
Has gone from all us .
And New year 2022 has come.
I most welcome to new .
I wish everyone blurTian!
I hope that everything will be good
in our life.
I congratulate from bottom of my heart.
Thanks!
@firdaus1998
I don't know how beautiful the work has been. But i hope it ha been much better. well, do you have google play link? if so ,please give me.
thanks@eastmael
Please see how @chinonso01 did it. He made a very good tutorial with screenshots.
https://blurt.blog/blurtopian/@chinonso01/blurtopian-dev-blurtkey-v0-1-0-google-play-release-beta-testing-or-or-tutorials-or-or-errors-found
Maybe the JS version you can release and use with the recovery tool as a solution. I hope you get some more holidays.
good job mr.@eastmael
Congratulations, your post has been curated by @dsc-r2cornell. You can use the tag #R2cornell. Also, find us on Discord
Felicitaciones, su publicación ha sido votada por @ dsc-r2cornell. Puedes usar el tag #R2cornell. También, nos puedes encontrar en Discord