Skip to content

Commit

Permalink
Merge branch 'dev' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
fayeed committed Aug 2, 2024
2 parents 4f9c622 + 4ea0111 commit 07872bf
Show file tree
Hide file tree
Showing 34 changed files with 174 additions and 81 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ This project _loosely_ adheres to [Semantic Versioning](https://semver.org/spec/
- Update the verify code header to show "Check Email" if using hosting. [PR#502](https://github.com/coasys/ad4m/pull/502)
- ad4m.expression.get() handles literal values client-side to avoid roundtrips, can be overridden with optional flag [PR#498](https://github.com/coasys/ad4m/pull/498)
- Update to Holochain 0.3.2-rc1 [PR#506](https://github.com/coasys/ad4m/pull/506)
- Make Prolog engine update O(1) in case of only having link additions [PR#510](https://github.com/coasys/ad4m/pull/510)

## [0.9.0] - 23/03/2024

Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ad4m-hooks/helpers/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coasys/hooks-helpers",
"version": "0.10.0-rc4",
"version": "0.10.0-rc5",
"description": "",
"main": "./src/index.ts",
"module": "./src/index.ts",
Expand Down
2 changes: 1 addition & 1 deletion ad4m-hooks/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coasys/ad4m-react-hooks",
"version": "0.10.0-rc4",
"version": "0.10.0-rc5",
"description": "",
"main": "./src/index.ts",
"module": "./src/index.ts",
Expand Down
2 changes: 1 addition & 1 deletion ad4m-hooks/vue/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coasys/ad4m-vue-hooks",
"version": "0.10.0-rc4",
"version": "0.10.0-rc5",
"description": "",
"main": "./src/index.ts",
"module": "./src/index.ts",
Expand Down
2 changes: 1 addition & 1 deletion bootstrap-languages/agent-language/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@
"md5": "^2.3.0",
"postcss": "^8.2.1"
},
"version": "0.10.0-rc4"
"version": "0.10.0-rc5"
}
2 changes: 1 addition & 1 deletion bootstrap-languages/direct-message-language/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
"dependencies": {
"@types/node": "^18.0.0"
},
"version": "0.10.0-rc4"
"version": "0.10.0-rc5"
}
2 changes: 1 addition & 1 deletion bootstrap-languages/neighbourhood-language/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
},
"author": "joshuadparkin@gmail.com",
"license": "ISC",
"version": "0.10.0-rc4"
"version": "0.10.0-rc5"
}
2 changes: 1 addition & 1 deletion bootstrap-languages/p-diff-sync/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@
"devDependencies": {
"run-script-os": "^1.1.6"
},
"version": "0.10.0-rc4"
"version": "0.10.0-rc5"
}
2 changes: 1 addition & 1 deletion bootstrap-languages/perspective-language/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@
"typescript": "^4.5.5",
"uint8arrays": "^3.0.0"
},
"version": "0.10.0-rc4"
"version": "0.10.0-rc5"
}
2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "ad4m"

version = "0.10.0-rc4"
version = "0.10.0-rc5"

edition = "2021"
authors = ["Nicolas Luck <nicolas.luck@coasys.org>"]
Expand Down
2 changes: 1 addition & 1 deletion connect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,5 @@
"esbuild-plugin-replace": "^1.4.0",
"lit": "^2.3.1"
},
"version": "0.10.0-rc4"
"version": "0.10.0-rc5"
}
20 changes: 16 additions & 4 deletions connect/src/components/Start.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { html } from "lit";
import { getForVersion } from "../utils";

export default function Start({
connect,
Expand All @@ -9,6 +10,9 @@ export default function Start({
scanQrcode,
hosting
}) {
const url = getForVersion('ad4murl') || "http://localhost:12000";
const isLocal = url.includes("localhost");

function clickLink(e: Event) {
e.preventDefault();
const el = e.currentTarget as HTMLLinkElement;
Expand Down Expand Up @@ -59,10 +63,18 @@ export default function Start({
</p>
</div>`}
<p style="height: 60px; color: red; font-size: 14px; text-align: center; margin: 0; margin-top: -30px;">
Please make sure you have the ADAM Launcher running on your computer and there are no browser restrictions ("Shields") blocking your connection to ADAM on localhost.
(Safari users: please use a different browser for now. Safari is very strict about this and we are working on a solution.)
</p>
${isLocal ? html`
<p style="height: 60px; color: red; font-size: 14px; text-align: center; margin: 0; margin-top: -30px;">
Please make sure you have the ADAM Launcher running on your computer and there are no browser restrictions ("Shields") blocking your connection to ADAM on localhost.
(Safari users: please use a different browser for now. Safari is very strict about this and we are working on a solution.)
</p>
` : html`
<p style="height: 60px; color: red; font-size: 14px; text-align: center; margin: 0; margin-top: -30px;">
Looks like the remote executor you are trying to connect to is not reachable.
Please try connecting to a different remote executor or check your connection settings.
</p>
`
}
<div class="text-center">
<a class="button button--link" _target="blank" href="https://ad4m.dev"
Expand Down
31 changes: 21 additions & 10 deletions connect/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,16 @@ export default class Ad4mConnect {
if (port) {
const found = await checkPort(port);
this.setPort(found);

return this.buildClient();
} else {
const port = await this.findPort();
this.setPort(port);
}
if (this.url.includes("localhost")) {
const port = await this.findPort();
this.setPort(port);

return this.buildClient();
return this.buildClient();
}
}
} catch (error) {
this.notifyConnectionChange("not_connected");
this.notifyAuthChange("unauthenticated");
Expand All @@ -266,6 +270,7 @@ export default class Ad4mConnect {
await connectWebSocket(this.url, 10000);
return this.buildClient();
} catch (e) {
this.notifyConnectionChange("not_connected");
return this.connectToPort();
}
}
Expand All @@ -290,9 +295,20 @@ export default class Ad4mConnect {

// Make sure the url is valid
try {
new WebSocket(this.url);
const websocket = new WebSocket(this.url);

websocket.onerror = (error) => {
this.notifyConnectionChange("not_connected");
};

setTimeout(() => {
if (websocket.readyState !== WebSocket.OPEN) {
this.notifyConnectionChange("not_connected");
}
}, 10000);
} catch (e) {
this.notifyConnectionChange("not_connected");
return;
}

if (this.apolloClient && this.wsClient) {
Expand All @@ -309,11 +325,6 @@ export default class Ad4mConnect {
},
}),
on: {
connecting: () => {
if (!this.requestedRestart) {
this.notifyConnectionChange("connecting");
}
},
opened: (socket: WebSocket) => {
this.activeSocket = socket;
},
Expand Down
24 changes: 12 additions & 12 deletions connect/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ function Timeout() {
export async function connectWebSocket(url, timeout = 10000) {
return Promise.race([
new Promise((resolve, reject) => {
if (!url.includes("localhost")) {
resolve(new WebSocket(url));
try {
const websocket = new WebSocket(url);

websocket.onopen = () => {
resolve(websocket);
};

websocket.onerror = (error) => {
reject(error);
};
} catch (e) {
reject(e);
}

const websocket = new WebSocket(url);

websocket.onopen = () => {
resolve(websocket);
};

websocket.onerror = (error) => {
reject(error);
};
}),
new Promise((resolve, reject) => {
setTimeout(() => {
Expand Down
24 changes: 17 additions & 7 deletions connect/src/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ export class Ad4mConnectElement extends LitElement {
this._isOpen = true;
}
if (event === "not_connected") {
this._isOpen = true;
this.changeUIState("start");
}
const customEvent = new CustomEvent("connectionstatechange", {
Expand Down Expand Up @@ -891,16 +892,24 @@ export class Ad4mConnectElement extends LitElement {
}
}

mobileView() {
if (this.mobile) {
return MobileAppLogoButton(({
openModal: () => {
this.changeUIState("settings");
this._isOpen = !this._isOpen;
}
}))
}

return null;
}

render() {
console.log(this.authState, this.connectionState, this.uiState, this._isOpen);
if (this._isOpen === false) {
if (this.authState === "authenticated" && this.mobile) {
return MobileAppLogoButton(({
openModal: () => {
this.changeUIState("settings");
this._isOpen = true;
}
}))
if (this.authState === "authenticated") {
return this.mobileView();
}

return null
Expand All @@ -911,6 +920,7 @@ export class Ad4mConnectElement extends LitElement {
<div class="dialog">
${Header()}
<main class="dialog__content">${this.renderViews()}</main>
${this.mobileView()}
</div>
<div class="ad4mConnect__backdrop" />
</div>
Expand Down
2 changes: 1 addition & 1 deletion core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"@types/yargs": "*"
},
"patchedDependencies": {},
"version": "0.10.0-rc4",
"version": "0.10.0-rc5",
"pnpm": {
"patchedDependencies": {
"graphql@15.7.2": "patches/graphql@15.7.2.patch"
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
"typedoc-plugin-markdown": "^3.15.2",
"typescript": "^4.9.3"
},
"version": "0.10.0-rc4"
"version": "0.10.0-rc5"
}
2 changes: 1 addition & 1 deletion executor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,5 @@
"tmp": "^0.2.1",
"uuid": "*"
},
"version": "0.10.0-rc4"
"version": "0.10.0-rc5"
}
2 changes: 1 addition & 1 deletion executor/src/core/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as path from 'node:path';
import * as fs from 'node:fs';
import { Address, Expression } from '@coasys/ad4m';

export let ad4mExecutorVersion = "0.10.0-rc4";
export let ad4mExecutorVersion = "0.10.0-rc5";
export let agentLanguageAlias = "did";
export let languageLanguageAlias = "lang";
export let neighbourhoodLanguageAlias = "neighbourhood";
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,5 @@
"safer-buffer@2.1.2": "patches/safer-buffer@2.1.2.patch"
}
},
"version": "0.10.0-rc4"
"version": "0.10.0-rc5"
}
2 changes: 1 addition & 1 deletion rust-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ad4m-client"
version = "0.10.0-rc4"
version = "0.10.0-rc5"
edition = "2021"
authors = ["Nicolas Luck <nicolas@coasys.org>"]
description = "Client library wrapping AD4M's GraphQL interface"
Expand Down
4 changes: 2 additions & 2 deletions rust-executor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ad4m-executor"
version = "0.10.0-rc4"
version = "0.10.0-rc5"
edition = "2021"
authors = ["Nicolas Luck <nicolas.luck@coasys.org>"]
description = "Runtime implementation of AD4M as library - https://ad4m.dev"
Expand Down Expand Up @@ -89,7 +89,7 @@ kitsune_p2p_types = { version = "0.3.2-rc.0", git = "https://github.com/coasys/h
scryer-prolog = { version = "0.9.4" }
# scryer-prolog = { path = "../../scryer-prolog", features = ["multi_thread"] }

ad4m-client = { path = "../rust-client", version="0.10.0-rc4" }
ad4m-client = { path = "../rust-client", version="0.10.0-rc5" }
reqwest = { version = "0.11.20", features = ["json", "native-tls"] }

rusqlite = { version = "0.29.0", git = "https://github.com/coasys/rusqlite.git", rev = "12ec1330bd4b46411ab9895364da4a3e172d0fbb", features = ["bundled"] }
Expand Down
2 changes: 1 addition & 1 deletion rust-executor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
"@coasys/ad4m-executor": "link:../core"
},
"dependencies": {},
"version": "0.10.0-rc4"
"version": "0.10.0-rc5"
}
2 changes: 1 addition & 1 deletion rust-executor/src/globals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use lazy_static::lazy_static;

lazy_static! {
/// The current version of AD4M
pub static ref AD4M_VERSION: String = String::from("0.10.0-rc4");
pub static ref AD4M_VERSION: String = String::from("0.10.0-rc5");
}

/// Struct representing oldest supported version and indicator if state should be cleared if update is required
Expand Down
Loading

0 comments on commit 07872bf

Please sign in to comment.