From 4a9565f91d67cbc57be5bb4370c3e640daf643fb Mon Sep 17 00:00:00 2001 From: Dhravya Shah Date: Mon, 5 Aug 2024 18:36:26 -0700 Subject: [PATCH] changes for staging --- apps/cf-ai-backend/bun.lockb | Bin 0 -> 2390 bytes apps/cf-ai-backend/src/helper.ts | 1 - apps/cf-ai-backend/wrangler.toml | 10 ++++----- apps/web/app/(auth)/onboarding/page.tsx | 14 +++++++------ .../web/app/(dash)/dialogContentContainer.tsx | 2 +- apps/web/app/(dash)/menu.tsx | 2 +- .../web/migrations/0001_Adding_jobs_table.sql | 19 ++++++++++++++++++ apps/web/wrangler.toml | 6 +++--- 8 files changed, 37 insertions(+), 17 deletions(-) create mode 100755 apps/cf-ai-backend/bun.lockb create mode 100644 apps/web/migrations/0001_Adding_jobs_table.sql diff --git a/apps/cf-ai-backend/bun.lockb b/apps/cf-ai-backend/bun.lockb new file mode 100755 index 0000000000000000000000000000000000000000..601774bc8ec9b714d662eabab7b82d5334cdb73d GIT binary patch literal 2390 zcmY#Z)GsYA(of3F(@)JSQ%EY!;{sycoc!eMw9K4T-L(9o+{6;yG6OCq1_p+X_TN_+ zPfa+=nzr<9c3-!&wG+efg;O_#U;l7&CtKh4`ePhGML@s`p%|cCINbmhFN7%o^930g z8Zz?p@S+q+kKr3G*+A2AK(qFc=LK0;?gc z?jQd@l57W=OaK7QV`PAsi)=K@`n+j}*-r5nI3!*_c>A8poSXL=u1CEMzk2Oz`s)RM zwSLw{vfN!Ozq4X_M&%M-S$3v7Szk0HmYm^EE?=7Ck{XnaWG*ZmK`vn_Rrr|kwfe%J zJ%=8N++@yN7|3C%b18QIuRrn+9}8GlJT`v+Kx)mBOOo*{FL|^}56ouSsk!n~g>%X? zmbY^D(N3&L=EA}YY;KH9En`Laq#IXOm9K2HXnFcGMx#xv``5E-N2&gI5tqW>?nub` zWixU2&$$mX-yK`Qf9=`bB^TBtxbYv`b5+J(_7#%3pmYiYEC;{uc-W${f6CtsssHEi z`M>vDefyhibM1zTX+|tB@*CeBU3ER;RkHQ;`s|aNlhn4IT&!IB@_NZ}nF)q}w`WXt zdWjsUFhd6cJxHBJTFC5x=AbiBn#-oRC|NHvuec;JCr1xf?&^gUrKZ{`7#S!OXI7== zr|Bq|C?w`&rsw6Sal!5T_a6d40-*T+0X33?4Wfk0rqtNT4yY4{8KCe4rE`#83#c9+ zBK3mwfb@dQ0AWzNZh-1#Vh3`7fXgP@$Sk(h0_YDjxEl;n{Q)cAVdXamBd|7L-~}26 zs|jEwJriS`fu50`Ap--fu7K4AKp7J~Q*1H zEp`C;T_5Nf-7;WuNJ%WoFUlw>DJZtm*Dp#<&nzw}s?^IX$jvI&%P&gT2P@VEQ@WrK zGS(|eufn4qi|P8hsJ7{X;=qW2IY9S8^%?6K8S7aPP>$2LKtoV`5A*~$jLeOIQ3^5? JoXiFx0RR)|yKw*j literal 0 HcmV?d00001 diff --git a/apps/cf-ai-backend/src/helper.ts b/apps/cf-ai-backend/src/helper.ts index eadd9c21..af9e6442 100644 --- a/apps/cf-ai-backend/src/helper.ts +++ b/apps/cf-ai-backend/src/helper.ts @@ -184,7 +184,6 @@ export async function batchCreateChunksAndEmbeddings({ const results = []; for (let i = 0; i < newVectors.length; i += 20) { results.push(newVectors.slice(i, i + 20)); - console.log(JSON.stringify(newVectors[1].id)); } await Promise.all( diff --git a/apps/cf-ai-backend/wrangler.toml b/apps/cf-ai-backend/wrangler.toml index 665ca593..ce1f1948 100644 --- a/apps/cf-ai-backend/wrangler.toml +++ b/apps/cf-ai-backend/wrangler.toml @@ -1,4 +1,4 @@ -name = "new-cf-ai-backend" +name = "dev-cf-ai-backend" main = "src/index.ts" compatibility_date = "2024-02-23" node_compat = true @@ -31,8 +31,8 @@ binding = "AI" [[kv_namespaces]] binding = "KV" -id = "569c3f2a510943729019f5d1f798e7d9" -preview_id = "569c3f2a510943729019f5d1f798e7d9" +id = "a68a8182f08e46a1b5d11588fdda68dc" +preview_id = "a68a8182f08e46a1b5d11588fdda68dc" [placement] mode = "smart" @@ -50,5 +50,5 @@ mode = "smart" [[d1_databases]] binding = "DATABASE" -database_name = "supermemlocal" -database_id = "0f93c990-72fb-489c-8563-57a7bb18dc43" +database_name = "staging-d1-supermemory" +database_id = "40a3bb06-82bd-42f1-aef4-fde04f3635c5" \ No newline at end of file diff --git a/apps/web/app/(auth)/onboarding/page.tsx b/apps/web/app/(auth)/onboarding/page.tsx index 5b728928..c311ea13 100644 --- a/apps/web/app/(auth)/onboarding/page.tsx +++ b/apps/web/app/(auth)/onboarding/page.tsx @@ -26,11 +26,13 @@ export default function Home() { await completeOnboarding(); }; if (currStep > 3) { - updateDb().then(() => { - push("/home?q=what%20is%20supermemory"); - }).catch((e) => { - console.error(e); - }); + updateDb() + .then(() => { + push("/home?q=what%20is%20supermemory"); + }) + .catch((e) => { + console.error(e); + }); } }, [currStep]); @@ -292,7 +294,7 @@ function StepThree({ currStep }: { currStep: number }) { }); if (cont.success) { - toast.success("Memory created", { + toast.success("Memory queued", { richColors: true, }); } else { diff --git a/apps/web/app/(dash)/dialogContentContainer.tsx b/apps/web/app/(dash)/dialogContentContainer.tsx index c6cacd35..1a11ac6d 100644 --- a/apps/web/app/(dash)/dialogContentContainer.tsx +++ b/apps/web/app/(dash)/dialogContentContainer.tsx @@ -76,7 +76,7 @@ export function DialogContentContainer({ setSelectedSpaces([]); if (cont.success) { - toast.success("Memory created", { + toast.success("Memory queued", { richColors: true, }); } else { diff --git a/apps/web/app/(dash)/menu.tsx b/apps/web/app/(dash)/menu.tsx index 1acab2c8..783a4780 100644 --- a/apps/web/app/(dash)/menu.tsx +++ b/apps/web/app/(dash)/menu.tsx @@ -128,7 +128,7 @@ function Menu() { setSelectedSpaces([]); if (cont.success) { - toast.success("Memory created", { + toast.success("Memory queued", { richColors: true, }); } else { diff --git a/apps/web/migrations/0001_Adding_jobs_table.sql b/apps/web/migrations/0001_Adding_jobs_table.sql new file mode 100644 index 00000000..7a687f72 --- /dev/null +++ b/apps/web/migrations/0001_Adding_jobs_table.sql @@ -0,0 +1,19 @@ +-- Migration number: 0001 2024-08-05T18:05:16.793Z +CREATE TABLE `jobs` ( + `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL, + `userId` text NOT NULL, + `url` text NOT NULL, + `status` text NOT NULL, + `attempts` integer DEFAULT 0 NOT NULL, + `lastAttemptAt` integer, + `error` blob, + `createdAt` integer NOT NULL, + `updatedAt` integer NOT NULL, + FOREIGN KEY (`userId`) REFERENCES `user`(`id`) ON UPDATE no action ON DELETE cascade +); + + +CREATE INDEX `jobs_userId_idx` ON `jobs` (`userId`);--> statement-breakpoint +CREATE INDEX `jobs_status_idx` ON `jobs` (`status`);--> statement-breakpoint +CREATE INDEX `jobs_createdAt_idx` ON `jobs` (`createdAt`);--> statement-breakpoint +CREATE INDEX `jobs_url_idx` ON `jobs` (`url`);--> statement-breakpoint \ No newline at end of file diff --git a/apps/web/wrangler.toml b/apps/web/wrangler.toml index a6232450..2e991ad9 100644 --- a/apps/web/wrangler.toml +++ b/apps/web/wrangler.toml @@ -1,4 +1,4 @@ -name = "supermemory" +name = "dev-supermemory" compatibility_date = "2024-03-29" compatibility_flags = [ "nodejs_compat" ] pages_build_output_dir = ".vercel/output/static" @@ -31,8 +31,8 @@ database_id = "fc562605-157a-4f60-b439-2a24ffed5b4c" [[env.production.d1_databases]] binding = "DATABASE" -database_name = "prod-d1-supermemory" -database_id = "f527a727-c472-41d4-8eaf-3d7ba0f2f395" +database_name = "staging-d1-supermemory" +database_id = "40a3bb06-82bd-42f1-aef4-fde04f3635c5" [env.preview.ai] binding = "AI"