humor-grad-school / humor-grad-school-web

2 stars 0 forks source link

Rework content writing functions not to use try-catch #14

Open bigfoodK opened 5 years ago

bigfoodK commented 5 years ago

Original structure was as follows

Converting blots to content is recursive task So, I used try-catch and throw to check error while uploading media Not to use try-catch, I divided functions

Now it is fixed as follows

namse commented 5 years ago

@bigfoodK I'm trying to improve encoding sequence. For instance, we can encode media at background during editing post.

Here is the Pseudo Code,

    // ...On Editing...
    // - Encode Media in background

    // Function writePost(Blots): Promise<void>
    // - Retry Encoding for failed encoding request on previous time.
    // - Check background encoding is successful
    // --> if fail to encode?
    // ----> warn to user and let them try again.
    // - Convert Blots to ElementData
    // - Upload post.
    // DONE

I'm on progress and fix/reworkContentWritingFunctions-namse is that branch. You can check that on commit 1496a19add2af8580ca7591b9adcc92b9295f2a8 , check PostWritePage.tsx. It's not done yet.