Coder Social home page Coder Social logo

elemental-chat-ui's Issues

Feature request: make identity more source-chain driven

Two changes:

  1. save agent_handle in source chain and retrieve it when starting chat
  2. ensure that browser keeps locally stored agent_key and agent_handle synced with source chain

Why:
HoloPort owners access their HoloPorts remotely. This means they may use multiple browsers / devices to access chat. We should keep identity synced to demo to the world that Holochain can keep track of identity / provenance since that is critical to advance usages such as payments.

Current situation:

  • Agent handle is saved in browser local storage only. Clearing cache or using a different browser/device prompts user to input a (new) agent handle
  • If a new agent key is created on a HoloPort through one browser, the old agent key remains in the other browser unless browser cache is cleared. This is probably an edge case (we shouldn't be regularly creating new agent keys) but we should still keep things synced regardless.

Bug: Websocket connection occasionally closes

Sometimes the websocket connection closes and then messages won't be received / new messages can't be sent. Browser does not appear to recover from this. We should at least implement a notification to reload the page if the websocket connection dies (auto-reconnecting would be great too)

image

UI tries to auto-login using anonymous agent keys saved in browser memory somewhere

Browser sometimes stores an anonymous agent key somewhere (Not in indexDB)

On future logins chaperone tries to auto-signin with these anonymous keys, which results in a 404 error from resolver and no login window.

This will hopefully be fixed by the sign-up / sign-in enhancements that handle these errors properly. In meantime, you need to clear browser history / cookies / etc.

Elemental chat UI won't work on Safari

Code is using method Blob.arrayBuffer() that is not supported on any Safari or older Chromes or Mozillas. Current market support for this method is 73%.

How to reproduce:

Open elemental chat on Safari, you will see in console an error:

Uncaught (in promise) TypeError: data.arrayBuffer is not a function

Zome 'profile' not found

I checked out the repos:

both on develop branches. Followed instructions to get up and running on my mac.

$ hc generate -a elemental-chat-test ../elemental-chat/elemental-chat.dna.gz

hc-admin: Creating 1 conductors with same settings
hc-admin: Config ConductorConfig { environment_path: EnvironmentRootPath("/var/folders/sw/cnn7jks16_bdhkxk16yxsrj00000gn/T/r9_KurP8uKGTFj1N8Dt0U"), use_dangerous_test_keystore: false, signing_service_uri: None, encryption_service_uri: None, decryption_service_uri: None, dpki: None, keystore_path: Some("/var/folders/sw/cnn7jks16_bdhkxk16yxsrj00000gn/T/r9_KurP8uKGTFj1N8Dt0U/keystore"), passphrase_service: None, admin_interfaces: None, network: None }
hc-admin: Created directory at: /var/folders/sw/cnn7jks16_bdhkxk16yxsrj00000gn/T/r9_KurP8uKGTFj1N8Dt0U Keep this path to rerun the same setup
hc-admin: Created config at /var/folders/sw/cnn7jks16_bdhkxk16yxsrj00000gn/T/r9_KurP8uKGTFj1N8Dt0U/conductor-config.yaml
Mar 18 20:03:54.917 ERROR lair_keystore_client: error=IpcClientConnectError("/private/var/folders/sw/cnn7jks16_bdhkxk16yxsrj00000gn/T/r9_KurP8uKGTFj1N8Dt0U/keystore/socket", Os { code: 2, kind: NotFound, message: "No such file or directory" }) file="/Users/harlan/.cargo/registry/src/github.com-1ecc6299db9ec823/lair_keystore_client-0.0.1-alpha.10/src/lib.rs" line=42

Conductor ready.

Hm, there was a lair error in there, not sure it that's a real issue for me or not. Boldly proceeding:

$ hc run --last --ports 8888

Conductor ready.
hc-admin: Running conductor on admin port 59230
hc-admin: Attaching app port 8888
hc-admin: Connected successfully to a running holochain

Sweet, now we go to the browser. The UI loads, at least this much of it:

Screen Shot 2021-03-18 at 8 22 15 PM

But in our server console we now see an error:

Mar 18 20:13:12.842 ERROR holochain_websocket::task_dispatch_incoming: error=Custom { kind: Other, error: SendError(WebsocketMessage::Close { close: WebsocketClosed { code: 1001, reason: "" } }) }
FATAL PANIC PanicInfo {
    payload: Any,
    message: Some(
        TODO: DnaError(ZomeNotFound("Zome \'profile\' not found")),
    ),
    location: Location {
        file: "/Users/harlan/code/holochain/crates/holochain/src/core/ribosome.rs",
        line: 336,
        col: 14,
    },
}
Well, this is embarrassing.

holochain had a problem and crashed. To help us diagnose the problem you can send us a crash report.

We have generated a report file at "/var/folders/sw/cnn7jks16_bdhkxk16yxsrj00000gn/T/report-e088df95-e28d-44fd-9a31-579d3785752e.toml". Submit an issue or email with the subject of "holochain Crash Report" and include the report as an attachment.

And in the toml file in question:

name = 'holochain'
operating_system = 'unix:OSX'
crate_version = '0.0.100'
explanation = '''
Panic occurred in file '.../holochain/crates/holochain/src/core/ribosome.rs' at line 336
'''
cause = '''TODO: DnaError(ZomeNotFound("Zome \'profile\' not found"))'''
method = 'Panic'
backtrace = '''

   0: 0x10a55f6f8 - std::sys_common::backtrace::__rust_end_short_backtrace::h9a7e5cc6475b496b
                at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/sys_common/backtrace.rs:141
   1: 0x10a561a5a - rust_begin_unwind
                at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/panicking.rs:493
   2: 0x10a5e2a2f - core::panicking::panic_fmt::h65997884a2662b8c
                at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/core/src/panicking.rs:92
   3: 0x10a5e2935 - core::option::expect_none_failed::h5e793a721927d8b0
                at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/core/src/option.rs:1268
   4: 0x108fa9fbd - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::ha834eb5e3758109d
   5: 0x108fa6c91 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::ha4b5d2efcb684945
   6: 0x108f57deb - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h124e697f997a7a12
   7: 0x1094993f0 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h5c3e4aed1d855f6c
   8: 0x109499364 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h5c3e4aed1d855f6c
   9: 0x1094b89b9 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::he3cdcbf9eb71913e
  10: 0x1094ac5d0 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::hc5284bcc310c49d8
  11: 0x108fccd95 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::he4079c23e6690378
  12: 0x108ef65f7 - <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h4f93c83ad088c4e8
  13: 0x1090ef9a9 - tokio::runtime::task::harness::Harness<T,S>::poll::h1a38f447c8af9d49
  14: 0x10a2a0e0f - std::thread::local::LocalKey<T>::with::ha33439f577c72912
  15: 0x10a2afd66 - tokio::runtime::thread_pool::worker::Context::run_task::hcf347c5c7a66e410
  16: 0x10a2af54e - tokio::runtime::thread_pool::worker::Context::run::h3d37c275f1d79e91
  17: 0x10a2a1b75 - tokio::macros::scoped_tls::ScopedKey<T>::set::h4a65cd2840a1b86b
  18: 0x10a2aefe5 - tokio::runtime::thread_pool::worker::run::h09caf211b60eab6d
  19: 0x10a2aa4bf - tokio::runtime::task::core::Core<T,S>::poll::h69bbc9a8096b42e8
  20: 0x10a293e76 - <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::hbac2317b2e59048b
  21: 0x10a2917e5 - tokio::runtime::task::harness::Harness<T,S>::poll::hc12b06d185d767fb
  22: 0x10a28d8ee - tokio::runtime::context::enter::h6308f27f402d67e4
  23: 0x10a2a08ef - std::sys_common::backtrace::__rust_begin_short_backtrace::ha371bc84161c427f
  24: 0x10a299d66 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h05fb6be266b030ad
  25: 0x10a568f7d - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hefcce43be1a2cb05
                at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/alloc/src/boxed.rs:1328
                 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h43e2f2a139a82d40
                at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/alloc/src/boxed.rs:1328
                 - std::sys::unix::thread::Thread::new::thread_start::he19012de44640be6
                at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b/library/std/src/sys/unix/thread.rs:71
  26: 0x7fff204aa950 - __pthread_start'''

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.