From 1c073db46f0040bf681bf1b528e2fb894ddee1ba Mon Sep 17 00:00:00 2001 From: Matt Gabrenya Date: Thu, 12 Oct 2023 13:10:45 -0700 Subject: [PATCH 1/7] build: bump flake lock --- flake.lock | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index d2d8707b..572e44c0 100644 --- a/flake.lock +++ b/flake.lock @@ -146,10 +146,7 @@ "empty": "empty", "flake-compat": "flake-compat", "flake-parts": "flake-parts", - "holochain": [ - "holonix", - "empty" - ], + "holochain": "holochain", "lair": [ "holonix", "empty" @@ -339,7 +336,7 @@ }, "versions": { "inputs": { - "holochain": "holochain", + "holochain": "holochain_2", "lair": "lair", "launcher": "launcher", "scaffolding": "scaffolding" From 5e7f8ea150d6ce47d04aa3e00ffbc81910169dc9 Mon Sep 17 00:00:00 2001 From: Jost Schulte Date: Wed, 7 Aug 2024 08:53:15 +0200 Subject: [PATCH 2/7] fix: enum serialization & client updates --- Cargo.toml | 4 +- .../zomes/coordinator/mews/Cargo.toml | 4 +- .../coordinator/mews/src/mew_to_responses.rs | 2 +- .../zomes/coordinator/profiles/Cargo.toml | 4 +- dnas/mewsfeed/zomes/integrity/mews/Cargo.toml | 4 +- .../zomes/integrity/profiles/Cargo.toml | 2 +- flake.lock | 25 ++++---- flake.nix | 2 +- package-lock.json | 21 ++++++- ui/package.json | 2 +- ui/src/App.vue | 6 +- ui/src/components/AgentProfileDetail.vue | 4 +- ui/src/components/BaseAgentProfileDetail.vue | 10 +--- ui/src/components/BaseMewListItem.vue | 20 +++++-- ui/src/components/BaseNotification.vue | 27 +++++---- ui/src/components/BaseSiteMenu.vue | 4 +- ui/src/components/ButtonFollow.vue | 4 +- ui/src/components/CreateMewDialog.vue | 10 ++-- ui/src/components/CreateMewInput.vue | 16 +++-- ui/src/components/CreatorsListDialog.vue | 4 +- ui/src/components/FollowersListDialog.vue | 4 +- ui/src/components/NetworkInfo.vue | 4 +- ui/src/components/RandomMewWithTagList.vue | 4 +- .../SearchEverythingDialogInput.vue | 4 +- ui/src/layouts/MainLayout.vue | 20 ++----- ui/src/pages/AgentProfile.vue | 4 +- ui/src/pages/DiscoverCreators.vue | 4 +- ui/src/pages/MewYarn.vue | 4 +- ui/src/pages/MewsFeed.vue | 4 +- ui/src/pages/MewsListAuthor.vue | 4 +- ui/src/pages/MewsListCashtag.vue | 4 +- ui/src/pages/MewsListHashtag.vue | 4 +- ui/src/pages/MewsListMention.vue | 4 +- ui/src/pages/MyNotifications.vue | 4 +- ui/src/stores/createMewDialog.ts | 2 +- ui/src/stores/notificationsRead.ts | 4 +- ui/src/types/types.ts | 23 ++++--- ui/src/utils/client.ts | 60 ++++++++++--------- 38 files changed, 187 insertions(+), 149 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f6678426..44671032 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,8 +10,8 @@ paste = "1.0" rand = "0.8.5" hc_prefix_index = "0.10.0" regex = "1.10.3" -hc_zome_profiles_coordinator = { git="https://github.com/holochain-open-dev/profiles.git", rev="a1a487c8d6a8fd9910ba9b3f26e47df0bf0d09ae"} -hc_zome_profiles_integrity = { git="https://github.com/holochain-open-dev/profiles.git", rev="a1a487c8d6a8fd9910ba9b3f26e47df0bf0d09ae"} +hc_zome_profiles_coordinator = { git = "https://github.com/holochain-open-dev/profiles.git", rev = "a1a487c8d6a8fd9910ba9b3f26e47df0bf0d09ae" } +hc_zome_profiles_integrity = { git = "https://github.com/holochain-open-dev/profiles.git", rev = "a1a487c8d6a8fd9910ba9b3f26e47df0bf0d09ae" } [workspace.dependencies.agent_pins] path = "dnas/mewsfeed/zomes/coordinator/agent_pins" diff --git a/dnas/mewsfeed/zomes/coordinator/mews/Cargo.toml b/dnas/mewsfeed/zomes/coordinator/mews/Cargo.toml index 53aaa7cd..535dd3dd 100644 --- a/dnas/mewsfeed/zomes/coordinator/mews/Cargo.toml +++ b/dnas/mewsfeed/zomes/coordinator/mews/Cargo.toml @@ -11,8 +11,8 @@ name = "mews" hdk = { workspace = true } serde = { workspace = true } regex = { workspace = true } -mews_integrity = { workspace = true } -hc_prefix_index = { git = "https://github.com/holochain-open-dev/holochain-prefix-index", module = "lib/hc_prefix_index" } +mews_integrity = { workspace = true } +hc_prefix_index = { git = "https://github.com/holochain-open-dev/holochain-prefix-index" } profiles_integrity = { workspace = true } mews_types = { workspace = true } rand = { workspace = true } diff --git a/dnas/mewsfeed/zomes/coordinator/mews/src/mew_to_responses.rs b/dnas/mewsfeed/zomes/coordinator/mews/src/mew_to_responses.rs index a5bec731..a1e17a20 100644 --- a/dnas/mewsfeed/zomes/coordinator/mews/src/mew_to_responses.rs +++ b/dnas/mewsfeed/zomes/coordinator/mews/src/mew_to_responses.rs @@ -35,7 +35,7 @@ pub struct GetResponsesForMewInput { pub fn get_response_hashes_for_mew( input: GetResponsesForMewInput, ) -> ExternResult> { - let tag = match input.response_type { + let _tag = match input.response_type { Some(response_type) => { let tag: SerializedBytes = response_type.try_into().map_err(|_| { wasm_error!(WasmErrorInner::Guest( diff --git a/dnas/mewsfeed/zomes/coordinator/profiles/Cargo.toml b/dnas/mewsfeed/zomes/coordinator/profiles/Cargo.toml index b19b486a..6ae1eab8 100644 --- a/dnas/mewsfeed/zomes/coordinator/profiles/Cargo.toml +++ b/dnas/mewsfeed/zomes/coordinator/profiles/Cargo.toml @@ -10,5 +10,5 @@ name = "profiles" [dependencies] hdk = { workspace = true } serde = { workspace = true } -profiles_integrity = { workspace = true } -hc_zome_profiles_coordinator = { git = "https://github.com/holochain-open-dev/profiles", branch = "for-hdk-v0.3.1", module = "crates/coordinator" } +profiles_integrity = { workspace = true } +hc_zome_profiles_coordinator = { git = "https://github.com/holochain-open-dev/profiles", branch = "for-hdk-v0.3.1" } diff --git a/dnas/mewsfeed/zomes/integrity/mews/Cargo.toml b/dnas/mewsfeed/zomes/integrity/mews/Cargo.toml index 87cad474..be8ced9e 100644 --- a/dnas/mewsfeed/zomes/integrity/mews/Cargo.toml +++ b/dnas/mewsfeed/zomes/integrity/mews/Cargo.toml @@ -11,5 +11,5 @@ name = "mews_integrity" hdi = { workspace = true } hdk = { workspace = true } serde = { workspace = true } -hc_prefix_index = { git = "https://github.com/holochain-open-dev/holochain-prefix-index", module = "lib/hc_prefix_index" } -mews_types = { workspace = true } \ No newline at end of file +hc_prefix_index = { git = "https://github.com/holochain-open-dev/holochain-prefix-index" } +mews_types = { workspace = true } diff --git a/dnas/mewsfeed/zomes/integrity/profiles/Cargo.toml b/dnas/mewsfeed/zomes/integrity/profiles/Cargo.toml index b240eb3d..f7d0e255 100644 --- a/dnas/mewsfeed/zomes/integrity/profiles/Cargo.toml +++ b/dnas/mewsfeed/zomes/integrity/profiles/Cargo.toml @@ -8,7 +8,7 @@ crate-type = ["cdylib", "rlib"] name = "profiles_integrity" [dependencies] -hc_zome_profiles_integrity = { git = "https://github.com/holochain-open-dev/profiles", branch = "for-hdk-v0.3.1", module = "crates/integrity" } +hc_zome_profiles_integrity = { git = "https://github.com/holochain-open-dev/profiles", branch = "for-hdk-v0.3.1" } hdi = { workspace = true } serde = { workspace = true } diff --git a/flake.lock b/flake.lock index 572e44c0..bfa61804 100644 --- a/flake.lock +++ b/flake.lock @@ -146,7 +146,10 @@ "empty": "empty", "flake-compat": "flake-compat", "flake-parts": "flake-parts", - "holochain": "holochain", + "holochain": [ + "holonix", + "empty" + ], "lair": [ "holonix", "empty" @@ -169,11 +172,11 @@ ] }, "locked": { - "lastModified": 1722598765, - "narHash": "sha256-k4SYTJlMvrJRefEuUmITdXbsVzd5vjmw4Wl/U9bYYb0=", + "lastModified": 1722992904, + "narHash": "sha256-zPwkcJzGhNrq3/5Ammh60co6WPvrXnO3Zixwm2YaI/w=", "owner": "holochain", "repo": "holochain", - "rev": "2bda9c4dc68acf467022833911e3c1d76073f3d4", + "rev": "d65150a5b83f805089c678b9d6f000fbf5c78655", "type": "github" }, "original": { @@ -320,11 +323,11 @@ "scaffolding": { "flake": false, "locked": { - "lastModified": 1722439136, - "narHash": "sha256-TlCogFMYSZtep5AhG7IrMDxq0Grze2B5LL59+j6am1E=", + "lastModified": 1722862548, + "narHash": "sha256-8FXBPbL2qXiDAhQbbPehRDuauEUb9V3Uc7K4YjC0ev4=", "owner": "holochain", "repo": "scaffolding", - "rev": "19567b5b2ac550216b3a1479893acf3f734921b4", + "rev": "fc557aa8164d23c5638faa5fe5ed99d30e8404b7", "type": "github" }, "original": { @@ -336,18 +339,18 @@ }, "versions": { "inputs": { - "holochain": "holochain_2", + "holochain": "holochain", "lair": "lair", "launcher": "launcher", "scaffolding": "scaffolding" }, "locked": { "dir": "versions/0_3", - "lastModified": 1722598765, - "narHash": "sha256-k4SYTJlMvrJRefEuUmITdXbsVzd5vjmw4Wl/U9bYYb0=", + "lastModified": 1722992904, + "narHash": "sha256-zPwkcJzGhNrq3/5Ammh60co6WPvrXnO3Zixwm2YaI/w=", "owner": "holochain", "repo": "holochain", - "rev": "2bda9c4dc68acf467022833911e3c1d76073f3d4", + "rev": "d65150a5b83f805089c678b9d6f000fbf5c78655", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 0b9c0ee9..8adf24c5 100644 --- a/flake.nix +++ b/flake.nix @@ -18,7 +18,7 @@ inputsFrom = [ holonix.devShells.${system}.holochainBinaries ]; packages = with pkgs; [ # add further packages from nixpkgs - nodejs + # nodejs ]; }; }; diff --git a/package-lock.json b/package-lock.json index 5573de32..5d659a4c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7869,7 +7869,7 @@ "@headlessui/vue": "^1.7.14", "@holo-host/web-sdk": "0.6.19-prerelease", "@holochain-open-dev/profiles": "^0.17.3", - "@holochain/client": "^0.16.10", + "@holochain/client": "^0.17.1", "@shoelace-style/shoelace": "^2.13.1", "@tanstack/query-persist-client-core": "^4.35.0", "@tanstack/query-sync-storage-persister": "^4.35.0", @@ -7911,6 +7911,25 @@ "vue-tsc": "^1.6.4" } }, + "ui/node_modules/@holochain/client": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/@holochain/client/-/client-0.17.1.tgz", + "integrity": "sha512-Jvh6DN+OdktV3KQH+tioRzvPT+LWJFBp1klMFG9vaccphIVvJN1LepJfRB8OyxW5iGAZ/TFCTwF19XSJuM1fQQ==", + "dependencies": { + "@bitgo/blake2b": "^3.2.4", + "@holochain/serialization": "^0.1.0-beta-rc.3", + "@msgpack/msgpack": "^2.8.0", + "emittery": "^1.0.1", + "isomorphic-ws": "^5.0.0", + "js-base64": "^3.7.5", + "libsodium-wrappers": "^0.7.13", + "lodash-es": "^4.17.21", + "ws": "^8.14.2" + }, + "engines": { + "node": ">=18.0.0 || >=20.0.0" + } + }, "ui/node_modules/@vitejs/plugin-vue": { "version": "4.2.3", "dev": true, diff --git a/ui/package.json b/ui/package.json index ef78277a..5e37b7a1 100644 --- a/ui/package.json +++ b/ui/package.json @@ -18,7 +18,7 @@ "@headlessui/vue": "^1.7.14", "@holo-host/web-sdk": "0.6.19-prerelease", "@holochain-open-dev/profiles": "^0.17.3", - "@holochain/client": "^0.16.10", + "@holochain/client": "^0.17.1", "@shoelace-style/shoelace": "^2.13.1", "@tanstack/query-persist-client-core": "^4.35.0", "@tanstack/query-sync-storage-persister": "^4.35.0", diff --git a/ui/src/App.vue b/ui/src/App.vue index 97f6d43e..ce7c185d 100644 --- a/ui/src/App.vue +++ b/ui/src/App.vue @@ -41,7 +41,7 @@ import { ProfilesClient, ProfilesStore, } from "@holochain-open-dev/profiles"; -import { AppAgentClient, AppInfo, encodeHashToBase64 } from "@holochain/client"; +import { AppClient, AppInfo, encodeHashToBase64 } from "@holochain/client"; import WebSdkApi from "@holo-host/web-sdk"; import { decode } from "@msgpack/msgpack"; import { MewsfeedDnaProperties } from "./types/types"; @@ -52,7 +52,7 @@ import { useThemeStore } from "@/stores/theme"; import { useQueryClient } from "@tanstack/vue-query"; import NetworkInfo from "./components/NetworkInfo.vue"; -const client = ref(); +const client = ref(); const appInfo = ref(); const profilesStore = ref(); const myProfile = ref(); @@ -101,6 +101,8 @@ const setupApp = async () => { // Setup profiles const profilesClient = new ProfilesClient( + // eslint-disable-next-line + // @ts-ignore toRaw(client.value), "mewsfeed", "profiles" diff --git a/ui/src/components/AgentProfileDetail.vue b/ui/src/components/AgentProfileDetail.vue index 10fd6106..50be13e9 100644 --- a/ui/src/components/AgentProfileDetail.vue +++ b/ui/src/components/AgentProfileDetail.vue @@ -9,7 +9,7 @@ diff --git a/ui/src/components/BaseMewListItem.vue b/ui/src/components/BaseMewListItem.vue index 269e7e35..d8efc870 100644 --- a/ui/src/components/BaseMewListItem.vue +++ b/ui/src/components/BaseMewListItem.vue @@ -317,7 +317,7 @@ import BaseAgentProfileLinkAvatar from "@/components/BaseAgentProfileLinkAvatar. import BaseMewContent from "@/components/BaseMewContent.vue"; import isEqual from "lodash/isEqual"; import { useRouter } from "vue-router"; -import { AppAgentClient } from "@holochain/client"; +import { AppClient } from "@holochain/client"; import BaseTimestamp from "@/components/BaseTimestamp.vue"; import dayjs from "dayjs"; import BaseEmbedMew from "@/components/BaseEmbedMew.vue"; @@ -364,7 +364,7 @@ const emit = defineEmits([ "mew-unpinned", ]); const router = useRouter(); -const client = (inject("client") as ComputedRef).value; +const client = (inject("client") as ComputedRef).value; const myProfile = inject("myProfile") as ComputedRef; const { showMessage, showError } = useToasts(); const { openCreateMewDialog, closeCreateMewDialog } = useCreateMewDialogStore(); @@ -376,10 +376,20 @@ const isUpdatingPin = ref(false); const isUpdatingLick = ref(false); const isMewmew = computed( - () => MewTypeName.Mewmew in props.feedMew.mew.mew_type + () => + typeof props.feedMew.mew.mew_type === "object" && + MewTypeName.Mewmew in props.feedMew.mew.mew_type +); +const isQuote = computed( + () => + typeof props.feedMew.mew.mew_type === "object" && + MewTypeName.Quote in props.feedMew.mew.mew_type +); +const isReply = computed( + () => + typeof props.feedMew.mew.mew_type === "object" && + MewTypeName.Reply in props.feedMew.mew.mew_type ); -const isQuote = computed(() => MewTypeName.Quote in props.feedMew.mew.mew_type); -const isReply = computed(() => MewTypeName.Reply in props.feedMew.mew.mew_type); const responseLabel = computed(() => isMewmew.value ? "mewmewed from" : isReply.value ? "replied to" : "quoted" ); diff --git a/ui/src/components/BaseNotification.vue b/ui/src/components/BaseNotification.vue index 8718fdb1..8e24518b 100644 --- a/ui/src/components/BaseNotification.vue +++ b/ui/src/components/BaseNotification.vue @@ -2,7 +2,7 @@
@@ -37,7 +38,7 @@
@@ -66,7 +67,7 @@
@@ -95,7 +96,7 @@
@@ -154,7 +155,7 @@
@@ -183,7 +184,7 @@
@@ -196,6 +197,7 @@
@@ -252,6 +256,7 @@
import { ROUTES } from "@/router"; -import { AppAgentClient, encodeHashToBase64 } from "@holochain/client"; +import { AppClient, encodeHashToBase64 } from "@holochain/client"; import { inject, ComputedRef } from "vue"; import { Profile } from "@holochain-open-dev/profiles"; import { makeUseNotificationsReadStore } from "@/stores/notificationsRead"; @@ -99,7 +99,7 @@ import IconGlobeOutline from "~icons/ion/globe-outline"; import IconSearch from "~icons/ion/search-outline"; import IconNotificationsOutline from "~icons/ion/notifications-outline"; -const client = (inject("client") as ComputedRef).value; +const client = (inject("client") as ComputedRef).value; const myProfile = inject("myProfile") as ComputedRef; const useNotificationsReadStore = makeUseNotificationsReadStore(client); diff --git a/ui/src/components/ButtonFollow.vue b/ui/src/components/ButtonFollow.vue index d349a3bd..5375d646 100644 --- a/ui/src/components/ButtonFollow.vue +++ b/ui/src/components/ButtonFollow.vue @@ -21,7 +21,7 @@ import { PROFILE_FIELDS } from "@/types/types"; import { AgentPubKey, encodeHashToBase64 } from "@holochain/client"; import { computed, ComputedRef, inject, ref, watch } from "vue"; import { Profile, ProfilesStore } from "@holochain-open-dev/profiles"; -import { AppAgentClient } from "@holochain/client"; +import { AppClient } from "@holochain/client"; import CreateProfileIfNotFoundDialog from "./CreateProfileIfNotFoundDialog.vue"; import isEqual from "lodash/isEqual"; import { setHomeRedirect } from "@/utils/homeRedirect"; @@ -40,7 +40,7 @@ const props = withDefaults( const emit = defineEmits(["toggle-follow"]); const profilesStore = (inject("profilesStore") as ComputedRef) .value; -const client = (inject("client") as ComputedRef).value; +const client = (inject("client") as ComputedRef).value; const myProfile = inject("myProfile") as ComputedRef; const { showMessage, showError } = useToasts(); diff --git a/ui/src/components/CreateMewDialog.vue b/ui/src/components/CreateMewDialog.vue index 58e41115..881fd2d5 100644 --- a/ui/src/components/CreateMewDialog.vue +++ b/ui/src/components/CreateMewDialog.vue @@ -2,7 +2,7 @@
@@ -29,6 +30,7 @@
- + @@ -200,7 +206,7 @@ import { import min from "lodash/min"; import union from "lodash/union"; import flatten from "lodash/flatten"; -import { AppAgentClient } from "@holochain/client"; +import { AppClient } from "@holochain/client"; import CreateProfileIfNotFoundDialog from "@/components/CreateProfileIfNotFoundDialog.vue"; import { ROUTES } from "@/router"; import { ProfilesStore } from "@holochain-open-dev/profiles"; @@ -221,7 +227,7 @@ const props = defineProps<{ mewType: MewType; }>(); const searchProfiles = useSearchProfiles(); -const client = (inject("client") as ComputedRef).value; +const client = (inject("client") as ComputedRef).value; const dnaProperties = ( inject("dnaProperties") as ComputedRef ).value; @@ -279,7 +285,7 @@ const linkTargetValid = computed(() => { }); const isMewTypeWithText = computed(() => { return ( - MewTypeName.Original in props.mewType || + props.mewType === MewTypeName.Original || MewTypeName.Reply in props.mewType || MewTypeName.Quote in props.mewType ); @@ -358,7 +364,7 @@ const publishMew = async (profile: undefined | Profile = undefined) => { payload: mew, }); emit("mew-created", feedMew); - if (MewTypeName.Original in mew.mew_type) { + if (mew.mew_type === MewTypeName.Original) { showMessage("Published Mew"); } } catch (error) { diff --git a/ui/src/components/CreatorsListDialog.vue b/ui/src/components/CreatorsListDialog.vue index d996fe85..cc767f7a 100644 --- a/ui/src/components/CreatorsListDialog.vue +++ b/ui/src/components/CreatorsListDialog.vue @@ -38,7 +38,7 @@