jaros1 / Money-Network

Demo with complementary and alternative money. Implemented in ZeroNet and AngularJS. Focus on privacy, encryption, max data in client and min data on ZeroNet. Work in progress.
GNU General Public License v2.0
4 stars 4 forks source link

Stil problems with deleted public chat / optional files #306

Closed jaros1 closed 6 years ago

jaros1 commented 6 years ago

Maybe this issue https://github.com/HelloZeroNet/ZeroNet/issues/1147 Sometimes public chat messages are deleted. Sometimes not? Test 1. created public chat, log out + log in OK, reloaded page and log in. Public chat was deleted. File was removed from file system and from content.json. Test 2. created public chat, log out + log in OK. Now seeing both old "deleted" public chat msg and new public chat msg. Reloaded MN, log in and still two public chat msg.

jaros1 commented 6 years ago

Expects public chat msg "MoneyNetwork update" to be deleted in a following page reload.

screenshot from 2018-01-19 09-16-06

jaros1 commented 6 years ago

Maybe an "error" in get_my_user_hub.step_2_compare_tables. Signing content.json files in case of mismatch between files in json table and files in files table (from content.json). Should normally be identical but can be out of sync in case of missing sign, file delete without sign or files deleted in OS.

Now using this workaround:

// # https://github.com/HelloZeroNet/ZeroNet/issues/1147
if (!content.files_optional || !Object.keys(content.files_optional).length) {
    console.log(pgm + 'issue #1147: ' + hub + ': no optional files in content.json') ;
}
else {
    console.log(pgm + 'issue #1147: content.files_optional = ' + JSON.stringify(content.files_optional)) ;
    if (show_debug('issue_1147')) {
        console.log(pgm + 'issue #1147: ' + hub + ': issue_1147=true: old workaround for siteSign failure. deleting content.files_optional before sign') ;
        delete content.files_optional ;
    }
    else console.log(pgm + 'issue #1147: ' + hub + ':issue_1147=false: new fix. keeping content.files_optional') ;
}

Removed workaround and added remove_missing_optional: true to siteSign (3 different places in MN code)

jaros1 commented 6 years ago

Closing this issue. No problems with deleted optional files with last 3 days