HelloZeroNet / ZeroNet

ZeroNet - Decentralized websites using Bitcoin crypto and BitTorrent network
https://zeronet.io
Other
18.33k stars 2.27k forks source link

"Save site settings" button or "Sign" button does nothing #1286

Open slrslr opened 6 years ago

slrslr commented 6 years ago

Step 1: Please describe your environment

Step 2: Describe the problem:

I have clonned ZeroTalk, i have created first topic. I opened (0) menu and tried to modify site name and description and click "Save site settings" and "Sign" button. Nothing happened. Site has only me as apeer (Onion: 1). When i reload page and click save site settings, i see this in developer console (F12):

[ZeroTalk] save scrollTop 0 all.js:457:7 [ZeroWebsocket] Closed close { target: WebSocket, isTrusted: true, wasClean: false, code: 1006, reason: "", currentTarget: WebSocket, eventPhase: 2, bubbles: false, cancelable: false, defaultPrevented: false, … } all.js:142:14 [Wrapper] Created! all.js:1546:14 [ZeroWebsocket] Open all.js:142:14 [ZeroTalk] inited! all.js:457:7 [ZeroTalk] restore scrollTop Object { scrollTop: 0 } 0 all.js:457:7 [Wrapper] actionSetViewport Object { cmd: "wrapperSetViewport", params: "width=device-width, initial-scale=0.8", wrapper_nonce: "removed", id: 1 } all.js:1546:14 [Wrapper] Setting title to myZeroTalk - ZeroNet all.js:1546:14 [User] Updating user info... undefined all.js:457:7 [ZeroTalk] Routing url: Topic:removed/removed&wrapper_nonce=removed all.js:457:7 [TopicShow] Loading topic... (Done in 148ms) all.js:457:7 [TopicShow] Loading comments... (Done in 168ms) all.js:457:7 [ZeroTalk] Adding inline editors (Done in 8ms) all.js:457:7 [Follow] Username mentions -> undefined all.js:457:7 [Follow] New topics -> undefined all.js:457:7 [ZeroTalk] Websocket callback not found: {…} cmd: "response" result: undefined to: 10 proto: {…} defineGetter: function defineGetter() defineSetter: function defineSetter() lookupGetter: function lookupGetter() lookupSetter: function lookupSetter() constructor: function Object() hasOwnProperty: function hasOwnProperty() isPrototypeOf: function isPrototypeOf() propertyIsEnumerable: function propertyIsEnumerable() toLocaleString: function toLocaleString() toSource: function toSource() toString: function toString() valueOf: function valueOf() all.js:457:7 [Sidebar] startDrag all.js:1596:7 [Sidebar] Moved all.js:1596:7 [Sidebar] Creating content all.js:1596:7 [Sidebar] Opened all.js:1596:7 loadGlobe true all.js:2399:7 [Sidebar] stopdrag opened: true all.js:1596:7 THREE.WebGLRenderer 69 all.js:1048:216 THREE.WebGLProgram: gl.getProgramInfoLog()

all.js:1110:154 THREE.WebGLProgram: gl.getProgramInfoLog() C:\fakepath(27,33-109): warning X3571: pow(f, e) will not work for negative f, use abs(f) or conditionally handle negative values if you expect them

all.js:1110:154 This site appears to use a scroll-linked positioning effect. This may not work well with asynchronous panning; see https://developer.mozilla.org/docs/Mozilla/Performance/ScrollLinkedEffects for further details and to join the discussion on related tools and features! 19removed

I checked the log file for interesting log entries and i see: [2018-02-13 11:40:16,786] DEBUG FileServer Conn#74741 64.137.251.65 [v2] > Socket error: UnpackValueError: Unknown header: 0xc1 in Connection.py line 185 > fallback.py line 557 > fallback.py line 538 > fallback.py line 537 > fallback.py line 498 > fallback.py line 494 [2018-02-13 11:40:30,592] DEBUG Site:mysiteaddress Websocket send error: UnicodeDecodeError: 'utf8' codec can't decode byte 0xe9 in position 232: invalid continuation byte in UiWebsocket.py line 202 > init.py line 244 > encoder.py line 207 > encoder.py line 270

purplesyringa commented 6 years ago

When you sign and publish a site, it is published to its peers only. If you want to get peers, ask other users to download the site.

slrslr commented 6 years ago

@imachug

i wanted not to publicize site yet because i have not even modified site name and logo. Is it required to have peer in order to change the zite name and description from within (0) menu? Because when i am not able to modify it that way and Sign button also do not return any message/result, it seems strange.

purplesyringa commented 6 years ago

Do you have any Unicode characters in site name/whatever?

slrslr commented 6 years ago

Inside main content.json of my zite, when i edited either title or description variable in this file to contain non english characters (ěščřžýáíé), then the mentioned "Save site settings" and "Sign" buttons on Zite does not work and shows no feedback on why not.

then i check back content.json and see non english characters turned into: ešcržýáíé (diacritics was removed from: ěčř)

yet "Save site settings" still not work. Please can zeronet be made to support these characters or show some informative message on why it failed to "Save site settings"?

purplesyringa commented 6 years ago

What happens when you remove title and description from content.json, open sidebar, sign content.json and try to change title/description via sidebar again?

slrslr commented 6 years ago

@imachug when i do that, then saving start working and the title i used (ěščřžýáíé 1 a) is added into content.json and looks like this: "title": "\u011b\u0161\u010d\u0159\u017e\u00fd\u00e1\u00ed\u00e9 1 a",

So it seems to be working, but the problem is when the user manually edit content.json and input non standard characters as i did, because it caused the issue of being unable to sign site and change its settings from (0) menu as described earlier in this issue/topic. It may be good if Sign / Save site site settings buttons show some helpful message to help discover why it stopped working

purplesyringa commented 6 years ago

when i do that, then saving start working and the title i used (ěščřžýáíé 1 a) is added into content.json and looks like this: "title": "\u011b\u0161\u010d\u0159\u017e\u00fd\u00e1\u00ed\u00e9 1 a",

That's because Unicode characters are not allowed in JSON and cause parse error.

didlie commented 6 years ago

The latest version of Chrome seems to be the most efficient and best working browser for ZeroNet. Handling the constant changes and inconsistencies in other browsers might become a frustrating and project-defeating focus for ZeroNet. The project itself has a high enough quality that it warrants creating a stable controllable Chromium browser optimized for ZeroNet. Thousands of hours of developer's time and will-to-work will be saved by focusing on a specific browser platform.

Chrome is the most stable across different operating systems and is open-source and supported by the billionaire club. Firefox builds are sometimes unstable and I believe developers have been paid from time-to-time by people at MS and GOOG to screw it up.

didlie commented 6 years ago

I solved the unicode issue with this class in PHP:


class pack
{

  public static function decode($string){
    return zlib_decode(hex2bin($string));
  }

  public static function encode($string){
    return bin2hex(zlib_encode($string, ZLIB_ENCODING_RAW));
  }
    public static function encodeMultiWordString($string){
        $string = explode(" ",$string);
        $i=0;
        do{
            $string[$i] = trim($string[$i]);
            if($string[$i] !== "") $string[$i] = self::encode($string[$i]);
            $i++;
        }while(isset($string[$i]));
        return implode(" ",$string);
    }

}```
didlie commented 6 years ago

But I really love the direct editing structure for the json file and believe that the process should not be layered and should be as transparent as it is, or even more so. Simple forms might be provided for site creation that enable new users to better understand what is actually going on when they create a new site, without reading documentation. And using Zlib encoding might be the easiest way to enable full UTF8 support.

purplesyringa commented 6 years ago

Chrome

Are you kidding? Chrome isn't open-source. Chromium is, but after they added telemetry there... I don't believe Google anymore.

Moreover, using one browser for ZeroNet means:

  1. Create that open-source multi-platform browser.
  2. If we decide to use Chrome, use C for all the code, and that means use C instead of Python, but the code cant be easy to be rewritten in pure C.
  3. Browsers for Android and iOS.
  4. Loose cross-platform feature.
ghost commented 6 years ago

I believe chrome uses C++ actually, but that doesn't negate the fact that it would be hard to rewrite everything in C++ - although I think it could be worth it to rewrite ZeroNet into a lower level language (not C++, but perhaps Rust - especially because of Rust's safety, zero abstraction costs, zero GC, etc). Although, this could reduce cross-platformness (Android and iOS), however, if you do it right, then you can call out from swift/java to the C++ or Rust program (of course how hard this is would depend on the libraries and tools available for C++ and Rust with each platform and that platform's primary language's ability to link out to each language).

didlie commented 6 years ago

Google stole my neuronetwork concatenation algorithm from my website software20.com !!!!! My Vocano concept software!!!!

didlie commented 6 years ago

They stole it from me when I went to their meeting in Tel Aviv and listed software20.com as my startup company

purplesyringa commented 6 years ago

offtop @didlie Google is evil.

didlie commented 6 years ago

My apologies for the non-sequitur...

@krixano Your documentation in: http://127.0.0.1:43110/DevCenter.bit/?/tutorials/users_databases_in_zeronet#h8

is good, but too wordy, and we need something that makes direct reference to code lines,... a code walk through for each functionality, not an abstract

didlie commented 6 years ago

@krixano Can you take the code and write your notes on top of the code, all your wordy descriptions inside the code to describe exactly where and how things are going on?? Shuffle your documentation into the code, and we will have something that we can understand and work with. As it is, your documentation in http://127.0.0.1:43110/DevCenter.bit/?/tutorials/users_databases_in_zeronet#h8 is too wordy... that means, too many words and not enough to say. Be direct. Comment the code.

HelloZeroNet commented 6 years ago

Please keep it on-topic.

ghost commented 6 years ago

@didlie

is good, but too wordy,

That's because they are tutorials, not references. Also, I believe I've said before that these are for beginners and give overview. They do not say anything about the specific internals of ZeroNet.

There is no code in the tutorial you are linking to precisely because it is about the concepts, not the code. This tutorial was not made for just zite developers, it was made to get the concept accross for developers and users. It is also meant to be simple.

Comment the code.

Again, there is no code in this tutorial, and this tutorial is not about the internals of ZeroNet, just the overall concept of how users and databases work.

All of this was stated at the beginning of the tutorial, if you actually bothered to read all of it:

... provides a basic overview of how Databases and Users ... ... so that both users and developers will understand them ... ... the purpose of Databases and Users in general ...

As per @HelloZeroNet 's request, we should move this conversation elsewhere, perhaps on Thunderwave?