context.ui functions stop working after calling redis functions

Open
#112 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
redis, typescript
Domain
api, backend

Research direction

No source file or test is identified in the issue. Start by reproducing the async processDescriptions flow from the onSubmit example, tracing context.redis calls followed by context.ui calls. Done means UI commands such as showToast and showForm still work after the Redis reads.

Written by the indexing model from the issue text.

Description

Details

After calling redis functions, the context.ui commands do not work anymore.
Thus i can't do toasts and can't showForms after fetching redis.

This is not experience post. You can find the src.zip a bit lower, but this is happening in context of onSubmit of first form.

Additional info

Discord message: _ok if i put the showToast like this, then it shows. but the context.ui is still UIClient {}

    async processDescriptions(context){
        context.ui.showToast('IS THIS WORKING?')  // Appears in the UI

        let stringArray = await context.redis.hGet('youtubePoster', 'stringArray')
        let currentIndex = await context.redis.hGet('youtubePoster', 'currentIndex')
        context.ui.showToast('IS THIS WORKING?')  // DOESN't appear in the UI

        let dataArray = JSON.parse(stringArray)
        
        let [link, title, description] = dataArray[currentIndex]

        // the context.ui commands not working after calling redis; i populated the data with testing, just for  testing. But link, title and description are correct
        context.ui.showForm(descriptionEditor, {
            link: "testing",
            title: "testing1",
            description: "testing2",
        });

    },
```_

**Message author:** anonymousgenerator

**Discord link:** <https://discord.com/channels/1050224141732687912/1050227353311248404/1297984878863716363>
Dominant language
TypeScript
Stars
210
Forks
88
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from reddit/devvit

All issues in reddit/devvit

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.