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

proxy.th3nd.com - invalid data.json file (new user) #207

Closed jaros1 closed 7 years ago

jaros1 commented 7 years ago

Cannot write invalid data.json file: Error in data.json JSON. Invalid json file. Error {"message":"String does not match pattern: ^[1-9][0-9].png$","params":{"pattern":"^[1-9][0-9].png$"},"code":202,"dataPath":"/users/0/avatar","schemaPath":"/properties/users/items/properties/avatar/pattern","subErrors":null}

screenshot from 2017-10-08 05-32-02

05:31:13.346 all.js?rev=2004&lang=zh-tw:9 [ZeroWebsocket] Open
05:31:13.351 30-ZeroFrame.js:7 [ZeroFrame] Websocket open
05:31:14.883 all.js?rev=2004&lang=zh-tw:87 [Wrapper] Setting title to MoneyNetwork - ZeroNet
05:31:52.392 all.js:3603 MoneyNetworkWService.w_login: getting sessions ...
05:31:52.468 all.js:15188 UserCtrl loaded
05:31:53.035 all.js:172 MoneyNetworkHubService.get_my_user_hub.step_1_merger_site_list: user_data_hubs = ["1PgyTnnACGd1XRdpfiDihgKwYRRnzgz2zh"]
05:31:54.136 all.js:161 MoneyNetworkHubService.get_my_user_hub.step_3_find_user_hubs dbQuery callback: hub = 1PgyTnnACGd1XRdpfiDihgKwYRRnzgz2zh
05:31:54.137 all.js:154 MoneyNetworkHubService.get_my_user_hub.step_6_run_callbacks: my_user_hub = 1PgyTnnACGd1XRdpfiDihgKwYRRnzgz2zh, other_user_hub = 1PgyTnnACGd1XRdpfiDihgKwYRRnzgz2zh
05:31:54.139 all.js:332 MoneyNetworkHubService.i_am_online get_my_user_hub callback 1: My cert_user_id is 1CceksUMqtsHs@moneynetwork.bit, my auth address is 1CceksUMqtsHsG2hDvbYiQf42qMvs4iwwJ, my unique id bc36aeb80938833a31853c79146e38245e44c32a8afa01c705800b4ec0d288f6 and my user data hub is 1PgyTnnACGd1XRdpfiDihgKwYRRnzgz2zh
05:31:54.141 all.js:2977 MoneyNetworkWService.create_sessions: todo: add callback to create_sessions. some tasks must run after sessions have been created (get_currencies)
05:31:54.153 all.js:2986 MoneyNetworkWService.create_sessions: todo: pubkey+pubkey2 combinations (other session) should be unique. only one sessionid is being used by the other session. last used sessionid is the correct session
05:31:54.154 MoneyNetworkAPI.js:41 MoneyNetworkAPILib.get_sessions: get_wallet_cbs.length = 0
05:31:54.155 all.js:3020 MoneyNetworkWService.create_sessions: sessions1 = []
05:31:54.155 all.js:3044 MoneyNetworkWService.create_sessions: sessions2 = {}
05:31:54.574 all.js:5631 MoneyNetworkService.z_contact_search dbQuery callback 2: current user not in data.users array. must be a new user (first save). Try again in 3 seconds
05:31:54.579 all.js:332 MoneyNetworkHubService.i_am_online get_data_json callback 2: Changed ZeroNet certificate. Creating data.json file
05:31:55.084 avatarundefined:1 GET https://proxy.th3nd.com/moneynetwork.bit/public/images/avatarundefined 403 ()
Image (async)
attr @ 10-jquery.js:517
access @ 10-jquery.js:255
attr @ 10-jquery.js:512
$set @ 40-angular.js:340
(anonymous) @ 40-angular.js:11065
(anonymous) @ 40-angular.js:341
forEach @ 40-angular.js:9
$set @ 40-angular.js:341
interpolateFnWatchAction @ 40-angular.js:458
interpolateFnWatcher @ 40-angular.js:1211
watchGroupAction @ 40-angular.js:5975
$digest @ 40-angular.js:6309
$apply @ 40-angular.js:6575
(anonymous) @ all.js:523
(anonymous) @ all.js:151
ZeroFrame.onMessage @ 30-ZeroFrame.js:2
(anonymous) @ 30-ZeroFrame.js:1
postMessage (async)
Wrapper.sendInner @ all.js?rev=2004&lang=zh-tw:75
Wrapper.onMessageWebsocket @ all.js?rev=2004&lang=zh-tw:53
(anonymous) @ all.js?rev=2004&lang=zh-tw:52
05:31:55.098 all.js:529 MoneyNetworkZService.z_update_1_data_json get_my_user_hub callback 1: hub = 1PgyTnnACGd1XRdpfiDihgKwYRRnzgz2zh, random_other_hub = 1PgyTnnACGd1XRdpfiDihgKwYRRnzgz2zh
05:31:55.098 all.js:281 MoneyNetworkHubService.get_user_seq get_data_json callback 1: users array in data.json is empty
05:31:55.472 all.js:281 MoneyNetworkHubService.get_user_seq get_data_json callback 1: users array in data.json is empty
05:31:55.868 all.js:530 MoneyNetworkZService.z_update_1_data_json get_data_json callback 4: data.hub = 1PgyTnnACGd1XRdpfiDihgKwYRRnzgz2zh
05:31:55.881 all.js:111 MoneyNetworkZService.z_update_4_data_json_write: Error in data.json JSON. Invalid json file{"message":"String does not match pattern: ^[1-9][0-9]*.png$","params":{"pattern":"^[1-9][0-9]*.png$"},"code":202,"dataPath":"/users/0/avatar","schemaPath":"/properties/users/items/properties/avatar/pattern","subErrors":null}
05:31:55.881 all.js:1933 MoneyNetworkZService.z_update_4_data_json_write: Cannot write invalid data.json file: Error in data.json JSON. Invalid json file.
Error {"message":"String does not match pattern: ^[1-9][0-9]*.png$","params":{"pattern":"^[1-9][0-9]*.png$"},"code":202,"dataPath":"/users/0/avatar","schemaPath":"/properties/users/items/properties/avatar/pattern","subErrors":null} 05:31:55.882 all.js:1934 MoneyNetworkZService.z_update_4_data_json_write: data = {"version":10,"users":[{"user_seq":1,"pubkey":"-----BEGIN PUBLIC KEY-----\nMIIBITANBgkqhkiG9w0BAQEFAAOCAQ4AMIIBCQKCAQBQbS/iMdRAK/dLF2rbamyL\nhVIu0no2bncCKAkT4/ky1Lch87w0iI+oJLuGCZgS5y3NKFKRDPGbmd+ChCysMacO\njR2UJcc9s4WRPCpVC1ZJPD5q3i3k54yPSw56IFvbEfEAWl4fvEkuEZx6dWTkCQaZ\nsWNC8dEn3GamgtNtQK6fb2eg/gJ2AGf7duGOmUELaHAM6Q+fO+9Q1HsxuyZT28/F\nEZi97oWV7LCKl141U4XrBfzTUpSBSHFOfQlnMofkfGSwYI0SfWRRmpXFY5UF763+\nt/ZU0v/r6Nu9NOyXH7u8qCXEEEWzg/hqI/e+BaSzUG/OpBkyNqxGvuRWKC7ttmQF\nAgMBAAE=\n-----END PUBLIC KEY-----","pubkey2":"AjQojRHq2GRY0yxpJ9RzwGKIatWTKFSjBUWXLi1b0T7v","encryption":"1","avatar":"undefined"}],"search":[{"user_seq":1,"tag":"Name","value":"Yvonne Heidenreich"},{"user_seq":1,"tag":"%","value":"%"}],"msg":[],"hub":"1PgyTnnACGd1XRdpfiDihgKwYRRnzgz2zh"} 05:31:55.882 all.js:1935 MoneyNetworkZService.z_update_4_data_json_write: Object.keys(data) = ["version","users","search","msg","hub"]
jaros1 commented 7 years ago

Could be 0 rows in public_avatars array. Maybe pending content.json download? Added a default avatar in case of 0 avatars in array + added a warning in download public avatars function in case # public avatars != 11

jaros1 commented 7 years ago

Testing from opera ...

jaros1 commented 7 years ago

Test OK from opera