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

ChatCraft 'crashes' when accessing Shared Chats or Searchbar #446

Closed
rjwignar opened this issue Feb 13, 2024 · 6 comments · Fixed by #469
Closed

ChatCraft 'crashes' when accessing Shared Chats or Searchbar #446

rjwignar opened this issue Feb 13, 2024 · 6 comments · Fixed by #469
Assignees
Labels
bug Something isn't working
Milestone

Comments

@rjwignar
Copy link
Collaborator

rjwignar commented Feb 13, 2024

After #431 @Amnish04 and I have noticed that attempting to access shared chats or using the search bar crashes ChatCraft:
sharedChatsCrash
searchbar Schema Error

          @humphd @Amnish04 The last time this happened, did it also affect Shared Chats and the Searchbar?

I'm also seeing issues accessing Shared Chats:
image

and when using the search bar:
image

Originally posted by @rjwignar in #442 (comment)

@humphd
Copy link
Collaborator

humphd commented Feb 13, 2024

What's in your console logs when this crash happens?

@rjwignar
Copy link
Collaborator Author

rjwignar commented Feb 14, 2024

@humphd

Shared Chats

When accessed from Shared Chats Tab

With Shared Chats (accessed from my Shared Chats tab), I get this error in my Dev Tools console:

{
    "status": 404,
    "statusText": "Not Found",
    "internal": true,
    "data": "Error: No route matches URL \"/api/share/rjwignar/bRw2wYMh5UvOc5J7UDen_\"",
    "error": {}
}

When I access the same chat via a share link, I get this error:

{
    "_e": {},
    "name": "DataError",
    "message": "Failed to execute 'get' on 'IDBObjectStore': The parameter is not a valid key.\n DataError: Failed to execute 'get' on 'IDBObjectStore': The parameter is not a valid key.",
    "inner": {
        "stack": "Error: Failed to execute 'get' on 'IDBObjectStore': The parameter is not a valid key.\n    at https://chatcraft.org/assets/index-sGYt3Ste.js:425:30652\n    at Kq (https://chatcraft.org/assets/index-sGYt3Ste.js:424:3694)\n    at new Be (https://chatcraft.org/assets/index-sGYt3Ste.js:424:3190)\n    at Object.get (https://chatcraft.org/assets/index-sGYt3Ste.js:425:30599)\n    at c.<computed> [as get] (https://chatcraft.org/assets/index-sGYt3Ste.js:425:51078)\n    at https://chatcraft.org/assets/index-sGYt3Ste.js:425:6066\n    at s (https://chatcraft.org/assets/index-sGYt3Ste.js:425:5768)\n    at https://chatcraft.org/assets/index-sGYt3Ste.js:425:4706\n    at m0 (https://chatcraft.org/assets/index-sGYt3Ste.js:425:3473)\n    at qc (https://chatcraft.org/assets/index-sGYt3Ste.js:425:2313)"
    }
}

Search Bar

When I type a keyword into the search bar and press , this error shows up in the Dev Tools console:

{
    "_e": {},
    "name": "SchemaError",
    "message": "KeyPath [searchText+messages] on object store chats is not indexed",
    "inner": null
}

@humphd
Copy link
Collaborator

humphd commented Feb 14, 2024

The first 404 is odd, since that object exists in the R2 bucket:

bRw2wYMh5UvOc5J7UDen_ text/html 99.66 KB February 7, 2024 8:32

For the second, this also exists in the bucket, but maybe not in your indexeddb for some reason? You should look for that key:

sXIHj-eLoiam6NEFM2rOB text/html 468.69 KB February 9, 2024 4:3

These two errors imply that we're somehow requesting the wrong key at the API level in the router (client side) or CloudFlare function?

The search error is different. It likely means we are trying to search on some field that is now not being indexed, maybe due to the data migration we did for the Image Preview change. We need to research this more.

@humphd
Copy link
Collaborator

humphd commented Feb 14, 2024

This share fails for me:

https://chatcraft.org/c/tarasglek/xp5A6rszHiqroXp22E6Ap

Loading that URL returns HTML. I can't easily reproduce this locally, but it would be good to figure this out.

@humphd humphd added the bug Something isn't working label Feb 14, 2024
@humphd humphd added this to the Release 1.3 milestone Feb 14, 2024
@Amnish04
Copy link
Collaborator

@Rachit1313 @humphd Are we moving this to 1.4?

@humphd
Copy link
Collaborator

humphd commented Feb 16, 2024

I have a PR up for it, let's do for 1.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants