Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: postgres needs the user to exist before you can add a participant #1219

Merged
merged 2 commits into from
Dec 19, 2024

Conversation

odilitime
Copy link
Collaborator

Risks

Low

Background

What does this PR do?

waits for users to be added before proceeding to adding participants

also moves the db check up before doing any db things

What kind of change is this?

Bug fixes (non-breaking change which fixes an issue)

Why are we doing this? Any context or related work?

 ["◎ Room c6dc9108-8990-0d80-a635-98d3a928f4e4 created successfully."] 

Error adding participant error: insert or update on table "participants" violates foreign key constraint "participants_userId_fkey"
    at /root/eliza-odi/node_modules/pg-pool/index.js:45:11
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async file:///root/eliza-odi/packages/adapter-postgres/dist/index.js:822:17
    at async PostgresDatabaseAdapter.withRetry (file:///root/eliza-odi/packages/adapter-postgres/dist/index.js:67:24)
    at async CircuitBreaker.execute (file:///root/eliza-odi/packages/core/dist/index.js:93:28)
    at async PostgresDatabaseAdapter.withCircuitBreaker (file:///root/eliza-odi/packages/core/dist/index.js:383:20)
    at async AgentRuntime.ensureParticipantExists (file:///root/eliza-odi/packages/core/dist/index.js:3661:13) {
  length: 305,
  severity: 'ERROR',
  code: '23503',
  detail: 'Key (userId)=(c6dc9108-8990-0d80-a635-98d3a928f4e4) is not present in table "accounts".',
  hint: undefined,
  position: undefined,
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: 'public',
  table: 'participants',
  column: undefined,
  dataType: undefined,
  constraint: 'participants_userId_fkey',
  file: 'ri_triggers.c',
  line: '2608',
  routine: 'ri_ReportViolation'
}
 ["✓ User WokeMindVirus created successfully."]

Documentation changes needed?

My changes do not require a change to the project documentation.

Copy link

codecov bot commented Dec 19, 2024

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
packages/core/src/runtime.ts 0.00% 6 Missing ⚠️
Files with missing lines Coverage Δ
packages/core/src/runtime.ts 0.00% <0.00%> (ø)

@monilpat monilpat changed the base branch from main to develop December 19, 2024 02:08
Copy link
Collaborator

@monilpat monilpat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@monilpat monilpat merged commit 21c63c4 into elizaOS:develop Dec 19, 2024
6 of 10 checks passed
AbdelStark added a commit to AbdelStark/eliza that referenced this pull request Dec 20, 2024
commit ea8cfb3
Merge: 2217ac0 242052b
Author: Monil Patel <monilpat@gmail.com>
Date:   Thu Dec 19 20:58:03 2024 -0800

    Merge pull request elizaOS#1262 from derRizzMeister/main

    feat: add README_DE.md in docs directory

commit 242052b
Merge: 2d8d74a 2217ac0
Author: Monil Patel <monilpat@gmail.com>
Date:   Thu Dec 19 20:57:44 2024 -0800

    Merge branch 'develop' into main

commit 2d8d74a
Author: Brandon Garvajal <brandon.garvajal@gmail.com>
Date:   Fri Dec 20 11:50:42 2024 +0700

    feat: add README_DE.md in docs directory

commit 2217ac0
Merge: e6de3a5 85c3af4
Author: Odilitime <janesmith@airmail.cc>
Date:   Thu Dec 19 20:23:23 2024 -0800

    Merge pull request elizaOS#1246 from tomguluson92/tomguluson92-patch-2

    feat: upgrade Tavily API with comprehensive input and constrain the token consumption

commit e6de3a5
Merge: 8c0709c d331665
Author: Shakker Nerd <165377636+shakkernerd@users.noreply.github.com>
Date:   Fri Dec 20 02:24:09 2024 +0000

    Merge pull request elizaOS#1258 from ai16z/tcm-claude-vertext-miss

    fix: unsupported model provider: claude_vertex

commit d331665
Author: Susanhu <susanhu@macbook-air.mynetworksettings.com>
Date:   Thu Dec 19 20:12:24 2024 -0500

    mapping claude vertex

commit 8c0709c
Merge: c4cfb8d 93ebd19
Author: Monil Patel <monilpat@gmail.com>
Date:   Thu Dec 19 15:34:11 2024 -0800

    Merge pull request elizaOS#1252 from ai16z/lalalune-patch-1

commit c4cfb8d
Merge: 2d04d80 e97cac5
Author: Monil Patel <monilpat@gmail.com>
Date:   Thu Dec 19 15:33:13 2024 -0800

    Merge pull request elizaOS#1254 from julienbrs/1253--add-twitter-automation-label-notice

commit e97cac5
Author: julienbrs <julien.bourseau@gmail.com>
Date:   Fri Dec 20 00:01:00 2024 +0100

    doc: add Twitter automation label notice (elizaOS#1253)

commit 93ebd19
Author: Shaw <shawmakesmagic@gmail.com>
Date:   Thu Dec 19 16:28:03 2024 -0600

    Update trump.character.json

    Remove a controversial line so we don't have to waste time on pointless old world political divisions

commit 2d04d80
Merge: 800cd0d a6f4bf6
Author: Monil Patel <monilpat@gmail.com>
Date:   Thu Dec 19 14:07:08 2024 -0800

    Merge pull request elizaOS#1250 from odilitime/fix-ll

    fix: Fix local_llama key warning

commit a6f4bf6
Merge: 5c9b4ff 800cd0d
Author: Monil Patel <monilpat@gmail.com>
Date:   Thu Dec 19 14:06:13 2024 -0800

    Merge branch 'develop' into fix-ll

commit 800cd0d
Merge: da405cd 31b336f
Author: Monil Patel <monilpat@gmail.com>
Date:   Thu Dec 19 14:05:56 2024 -0800

    Merge pull request elizaOS#1245 from renlulu/feat/express-payload-config

    feat: make express payload limit configurable

commit 31b336f
Merge: 9b25e9a da405cd
Author: Monil Patel <monilpat@gmail.com>
Date:   Thu Dec 19 14:05:24 2024 -0800

    Merge branch 'develop' into feat/express-payload-config

commit da405cd
Merge: 34a04ba cb0fad1
Author: Monil Patel <monilpat@gmail.com>
Date:   Thu Dec 19 14:04:22 2024 -0800

    Merge pull request elizaOS#1202 from netdragonx/main

    fix: optional chaining on search to avoid startup errors when search is not enabled

commit cb0fad1
Merge: 1aee80d 34a04ba
Author: Monil Patel <monilpat@gmail.com>
Date:   Thu Dec 19 14:03:34 2024 -0800

    Merge branch 'develop' into main

commit 9b25e9a
Merge: 4dd6d89 34a04ba
Author: Monil Patel <monilpat@gmail.com>
Date:   Thu Dec 19 14:03:01 2024 -0800

    Merge branch 'develop' into feat/express-payload-config

commit 34a04ba
Merge: 5a023c7 08a5aad
Author: Monil Patel <monilpat@gmail.com>
Date:   Thu Dec 19 14:02:52 2024 -0800

    Merge pull request elizaOS#1242 from ai16z/tcm-twitter-character-template-issue

    fix: twitterShouldRespondTemplate Fails When Defined as a String in JSON Character Config

commit 5a023c7
Merge: 2f157b6 f4e781c
Author: Monil Patel <monilpat@gmail.com>
Date:   Thu Dec 19 14:02:33 2024 -0800

    Merge pull request elizaOS#1243 from luisalrp/fix-cicd-package-visibility

    Fix visibility issue github image cicd

commit f4e781c
Merge: a4f20db 2f157b6
Author: Monil Patel <monilpat@gmail.com>
Date:   Thu Dec 19 14:01:19 2024 -0800

    Merge branch 'develop' into fix-cicd-package-visibility

commit 4dd6d89
Merge: 4004a02 2f157b6
Author: Monil Patel <monilpat@gmail.com>
Date:   Thu Dec 19 14:01:11 2024 -0800

    Merge branch 'develop' into feat/express-payload-config

commit 08a5aad
Merge: 80a1b83 2f157b6
Author: Monil Patel <monilpat@gmail.com>
Date:   Thu Dec 19 13:58:35 2024 -0800

    Merge branch 'develop' into tcm-twitter-character-template-issue

commit 2f157b6
Merge: bb82b05 c98840c
Author: Monil Patel <monilpat@gmail.com>
Date:   Thu Dec 19 13:56:53 2024 -0800

    Merge pull request elizaOS#1237 from yjshi2015/main

    Update trump.character.json - Enhance terminology in the project for clarity and inclusivity

commit c98840c
Merge: 3a9586e bb82b05
Author: Monil Patel <monilpat@gmail.com>
Date:   Thu Dec 19 13:56:21 2024 -0800

    Merge branch 'develop' into main

commit bb82b05
Merge: 6cb9134 d552cf8
Author: Monil Patel <monilpat@gmail.com>
Date:   Thu Dec 19 13:55:23 2024 -0800

    Merge pull request elizaOS#1236 from azurwastaken/fix/typo

    Update README for french, spanish and italian language

commit d552cf8
Merge: b7eca66 6cb9134
Author: Monil Patel <monilpat@gmail.com>
Date:   Thu Dec 19 13:54:58 2024 -0800

    Merge branch 'develop' into fix/typo

commit 6cb9134
Merge: 1edb372 90a6b91
Author: Monil Patel <monilpat@gmail.com>
Date:   Thu Dec 19 13:54:31 2024 -0800

    Merge pull request elizaOS#1239 from jonathangus/develop

    fix: Sync UI Client with server port env

commit 90a6b91
Merge: ea61561 1edb372
Author: Monil Patel <monilpat@gmail.com>
Date:   Thu Dec 19 13:53:32 2024 -0800

    Merge branch 'develop' into develop

commit 1edb372
Merge: 86005ad 370ea70
Author: Monil Patel <monilpat@gmail.com>
Date:   Thu Dec 19 13:52:55 2024 -0800

    Merge pull request elizaOS#1244 from renlulu/feat/env-twitter-retry

    feat: make twitter login retry times as env

commit 5c9b4ff
Author: odilitime <janesmith@airmail.cc>
Date:   Thu Dec 19 21:33:59 2024 +0000

    handle llama_local getTokenForProvider properly

commit 85c3af4
Author: tomguluson92 <314913739@qq.com>
Date:   Fri Dec 20 03:21:17 2024 +0800

    Update .env.example

commit db43e13
Author: tomguluson92 <314913739@qq.com>
Date:   Fri Dec 20 03:19:54 2024 +0800

    Update index.ts

commit 832a274
Author: tomguluson92 <314913739@qq.com>
Date:   Fri Dec 20 03:18:29 2024 +0800

    Update generation.ts

commit 4004a02
Merge: c905d7c 86005ad
Author: xiaohuo <xiaohuo@altresear.ch>
Date:   Fri Dec 20 02:14:16 2024 +0800

    Merge branch 'develop' into feat/express-payload-config

commit 370ea70
Merge: 8046d29 86005ad
Author: xiaohuo <xiaohuo@altresear.ch>
Date:   Fri Dec 20 02:13:37 2024 +0800

    Merge branch 'develop' into feat/env-twitter-retry

commit c905d7c
Author: xiaohuo <xiaohuo200@gmail.com>
Date:   Fri Dec 20 02:11:38 2024 +0800

    feat: make express payload limit configurable

commit 8046d29
Author: xiaohuo <xiaohuo200@gmail.com>
Date:   Fri Dec 20 01:52:57 2024 +0800

    chore: env update

commit fe3afef
Author: xiaohuo <xiaohuo200@gmail.com>
Date:   Fri Dec 20 01:51:01 2024 +0800

    feat: make twitter retry limit a env

commit 80a1b83
Author: Ting Chien Meng <tcm390@nyu.edu>
Date:   Thu Dec 19 11:30:17 2024 -0500

    treat twitterShouldRespondTemplate as string

commit a4f20db
Author: Luis Alberto Rodrigo <a_luisal@hotmail.com>
Date:   Thu Dec 19 17:23:18 2024 +0100

    Fix visibility issue github image cicd

commit ea61561
Author: Jonathan Gustafsson <jonathangus@proton.me>
Date:   Thu Dec 19 14:25:50 2024 +0100

    Fix: Sync UI Client with server port env

commit 3a9586e
Author: Gavin <495054021@qq.com>
Date:   Thu Dec 19 20:16:15 2024 +0800

    Enhance terminology in the project for clarity and inclusivity

commit b7eca66
Merge: 37fb32f 86005ad
Author: azurwastaken <caseaux.maxime@gmail.com>
Date:   Thu Dec 19 12:26:49 2024 +0100

    Merge branch 'develop' into fix/typo

commit 37fb32f
Author: azurwastaken <caseaux.maxime@gmail.com>
Date:   Thu Dec 19 12:20:46 2024 +0100

    Update README_IT.md

commit 84bdd46
Author: azurwastaken <caseaux.maxime@gmail.com>
Date:   Thu Dec 19 12:14:53 2024 +0100

    Update README_ES.md

commit 43699ba
Author: azurwastaken <caseaux.maxime@gmail.com>
Date:   Thu Dec 19 12:10:57 2024 +0100

    fix type in french Readme

commit 86005ad
Merge: d990859 f500c8d
Author: Shakker Nerd <165377636+shakkernerd@users.noreply.github.com>
Date:   Thu Dec 19 07:46:36 2024 +0000

    Merge pull request elizaOS#1229 from simpletrontdip/enhance-tele-client

    feat: add parse mode=Markdown, enhance telegram bot output

commit d990859
Merge: 76960dd 31b2b25
Author: Shakker Nerd <165377636+shakkernerd@users.noreply.github.com>
Date:   Thu Dec 19 07:43:27 2024 +0000

    Merge pull request elizaOS#1214 from vpavlin/fix/akash

    fix: fail when cannot get token, add Akash to generateText switch

commit f500c8d
Merge: 92ddabb 76960dd
Author: Lê Thông <thongitbk@gmail.com>
Date:   Thu Dec 19 14:40:54 2024 +0700

    Merge branch 'develop' into enhance-tele-client

commit 31b2b25
Merge: 97b5d15 76960dd
Author: Shakker Nerd <165377636+shakkernerd@users.noreply.github.com>
Date:   Thu Dec 19 07:38:33 2024 +0000

    Merge branch 'develop' into fix/akash

commit 97b5d15
Author: Shakker Nerd <165377636+shakkernerd@users.noreply.github.com>
Date:   Thu Dec 19 07:35:54 2024 +0000

    feat: include akash to handleProvider

commit 76960dd
Merge: 50ef711 d8f9001
Author: Shakker Nerd <165377636+shakkernerd@users.noreply.github.com>
Date:   Thu Dec 19 06:56:56 2024 +0000

    Merge pull request elizaOS#1218 from danbednarski/twitter-credentials

    chore: clean up scripts

commit d8f9001
Merge: f07efc9 50ef711
Author: Shakker Nerd <165377636+shakkernerd@users.noreply.github.com>
Date:   Thu Dec 19 06:56:18 2024 +0000

    Merge branch 'develop' into twitter-credentials

commit 50ef711
Merge: 21c63c4 bb5caa5
Author: Shakker Nerd <165377636+shakkernerd@users.noreply.github.com>
Date:   Thu Dec 19 06:44:22 2024 +0000

    Merge pull request elizaOS#1226 from tomguluson92/patch-2

    fix: CircuitBreaker.ts

commit bb5caa5
Merge: b8f9d81 21c63c4
Author: Shakker Nerd <165377636+shakkernerd@users.noreply.github.com>
Date:   Thu Dec 19 06:37:04 2024 +0000

    Merge branch 'develop' into patch-2

commit 92ddabb
Author: simpletrontdip <thongitbk@gmail.com>
Date:   Thu Dec 19 13:35:17 2024 +0700

    feat: add parse mode, support telebot output in markdown

commit b8f9d81
Author: tomguluson92 <314913739@qq.com>
Date:   Thu Dec 19 12:48:04 2024 +0800

    feat: CircuitBreaker.ts

commit 21c63c4
Merge: 392efc6 97d474f
Author: Monil Patel <monilpat@gmail.com>
Date:   Wed Dec 18 18:09:08 2024 -0800

    Merge pull request elizaOS#1219 from odilitime/postgres-fix

    fix: postgres needs the user to exist before you can add a participant

commit 392efc6
Merge: d3d6198 cd5fc2f
Author: Monil Patel <monilpat@gmail.com>
Date:   Wed Dec 18 18:06:18 2024 -0800

    Merge pull request elizaOS#1220 from ai16z/tcm-telegram-image

    fix: Allow the bot to post messages with images generated by the imageGenerationPlugin on Telegram.

commit cd5fc2f
Author: Ting Chien Meng <tcm390@nyu.edu>
Date:   Wed Dec 18 19:25:30 2024 -0500

    handle http image

commit e47b1d9
Author: Ting Chien Meng <tcm390@nyu.edu>
Date:   Wed Dec 18 19:14:07 2024 -0500

    clean code

commit 97d474f
Merge: 3c230b4 81d0273
Author: Odilitime <janesmith@airmail.cc>
Date:   Wed Dec 18 16:06:50 2024 -0800

    Merge branch 'main' into postgres-fix

commit 7ac6616
Author: Ting Chien Meng <tcm390@nyu.edu>
Date:   Wed Dec 18 19:05:57 2024 -0500

    correct content type

commit 98fbe39
Author: Ting Chien Meng <tcm390@nyu.edu>
Date:   Wed Dec 18 19:03:16 2024 -0500

    check content type

commit 6b25b8c
Author: Ting Chien Meng <tcm390@nyu.edu>
Date:   Wed Dec 18 19:02:02 2024 -0500

    support image message

commit d3d6198
Merge: 962d1b9 7aa0902
Author: cygaar <97691933+cygaar@users.noreply.github.com>
Date:   Wed Dec 18 19:00:39 2024 -0500

    Merge pull request elizaOS#1217 from cygaar/improve_twitter

    fix: improve twitter post generation prompt

commit 3c230b4
Author: odilitime <janesmith@airmail.cc>
Date:   Wed Dec 18 23:46:30 2024 +0000

    postgres needs the user to exist before you can add a participant

commit 7aa0902
Author: cygaar <tmpftl1@gmail.com>
Date:   Wed Dec 18 18:34:53 2024 -0500

    Update

commit f07efc9
Author: Dan Bednarski <the.jesus.aviles@gmail.com>
Date:   Wed Dec 18 17:08:29 2024 -0600

    Delete scripts/tweetextractor.mjs

commit d8f80bf
Author: Dan Bednarski <the.jesus.aviles@gmail.com>
Date:   Wed Dec 18 17:08:05 2024 -0600

    Rename gettweets-copy.mjs to gettweets.mjs

commit 646acea
Author: cygaar <tmpftl1@gmail.com>
Date:   Wed Dec 18 18:00:49 2024 -0500

    Improve generation prompt

commit 21ed0f2
Author: Václav Pavlín <vaclav.pavlin@gmail.com>
Date:   Wed Dec 18 22:14:47 2024 +0100

    fix: fail when cannot get token, add Akash to generateText switch

commit 90c84be
Author: Dan Bednarski <the.jesus.aviles@gmail.com>
Date:   Wed Dec 18 10:51:28 2024 -0600

    Delete scripts/gettweets.mjs

commit 1aee80d
Author: netdragonx <netdragon0x@gmail.com>
Date:   Wed Dec 18 01:27:23 2024 -0800

    Fix: optional chaining on search to prevent error when search is uncommented but not enabled in env file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants