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

Comment box not shrinking on submit #13298

Closed
Link2Twenty opened this issue Apr 7, 2021 · 17 comments · Fixed by #13686
Closed

Comment box not shrinking on submit #13298

Link2Twenty opened this issue Apr 7, 2021 · 17 comments · Fixed by #13686
Assignees
Labels
area: design Use for all tasks related to UX, UI, visual, or interaction design. bug smash Approved bugs for the DEV community bug smash bug always open for contribution external contributors welcome contribution is welcome! tech: frontend changes will primarily involve frontend technologies

Comments

@Link2Twenty
Copy link
Contributor

Describe the bug
Comment boxes grow as you type but when you press submit they stay the size they were when they had content.

To Reproduce

  • Go to a post
  • Write a long comment
  • Post the comment
  • See the comment box is still large.

Expected behaviour
I'd expect the comment box the shrink back down to it's original size.

Screenshots
image

Desktop (please complete the following information):

  • OS, version: Window 10
  • Browser, version: Chrome 89.0.4389.114

Additional context
Another small bug that doesn't really cause any harm.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 7, 2021

Thanks for the issue, we will take it into consideration! Our team of engineers is busy working on many types of features, please give us time to get back to you.

Feature requests that require more discussion may be closed. Read more about our feature request process on forem.dev.

To our amazing contributors: issues labeled type: bug are always up for grabs, but for feature requests, please wait until we add a ready for dev before starting to work on it.

To claim an issue to work on, please leave a comment. If you've claimed the issue and need help, please ping @forem/oss. The OSS Community Manager or the engineers on OSS rotation will follow up.

For full info on how to contribute, please check out our contributors guide.

@cmgorton
Copy link
Contributor

cmgorton commented Apr 7, 2021

I noticed this yesterday too! Thanks for submitting an issue.

@cmgorton cmgorton added bug always open for contribution area: comments tech: frontend changes will primarily involve frontend technologies area: design Use for all tasks related to UX, UI, visual, or interaction design. external contributors welcome contribution is welcome! labels Apr 7, 2021
@oyeyipo
Copy link
Contributor

oyeyipo commented Apr 30, 2021

Hey @cmgorton, I would like to solve this. Thanks.

@cmgorton
Copy link
Contributor

Thanks @oyeyipowale ! I'll assign you to the issue.

@oyeyipo
Copy link
Contributor

oyeyipo commented May 2, 2021

Hey @cmgorton, thanks for the response.

I ran into some issues while trying to set up the project using the container (docker) on windows 10. Two compose services are having trouble connecting and I do not know how to debug them.

sidekiq_1        | 2021/05/02 08:09:46 Problem with request: Get http://rails:3000: dial tcp 172.20.0.2:3000: connect: connection refused. Sleeping 20s
seed_1           | 2021/05/02 08:10:04 Problem with request: Get http://rails:3000: dial tcp 172.20.0.2:3000: connect: connection refused. Sleeping 20s
sidekiq_1        | 2021/05/02 08:10:06 Problem with request: Get http://rails:3000: dial tcp 172.20.0.2:3000: connect: connection refused. Sleeping 20s
seed_1           | 2021/05/02 08:10:24 Problem with request: Get http://rails:3000: dial tcp 172.20.0.2:3000: connect: connection refused. Sleeping 20s
sidekiq_1        | 2021/05/02 08:10:26 Problem with request: Get http://rails:3000: dial tcp 172.20.0.2:3000: connect: connection refused. Sleeping 20s
seed_1           | 2021/05/02 08:10:44 Problem with request: Get http://rails:3000: dial tcp 172.20.0.2:3000: connect: connection refused. Sleeping 20s
sidekiq_1        | 2021/05/02 08:10:46 Problem with request: Get http://rails:3000: dial tcp 172.20.0.2:3000: connect: connection refused. Sleeping 20s
seed_1           | 2021/05/02 08:11:04 Problem with request: Get http://rails:3000: dial tcp 172.20.0.2:3000: connect: connection refused. Sleeping 20s
sidekiq_1        | 2021/05/02 08:11:06 Problem with request: Get http://rails:3000: dial tcp 172.20.0.2:3000: connect: connection refused. Sleeping 20s
seed_1           | 2021/05/02 08:11:24 Problem with request: Get http://rails:3000: dial tcp 172.20.0.2:3000: connect: connection refused. Sleeping 20s
sidekiq_1        | 2021/05/02 08:11:26 Problem with request: Get http://rails:3000: dial tcp 172.20.0.2:3000: connect: connection refused. Sleeping 20s
seed_1           | 2021/05/02 08:11:44 Problem with request: Get http://rails:3000: dial tcp 172.20.0.2:3000: connect: connection refused. Sleeping 20s
sidekiq_1        | 2021/05/02 08:11:46 Problem with request: Get http://rails:3000: dial tcp 172.20.0.2:3000: connect: connection refused. Sleeping 20s
seed_1           | 2021/05/02 08:12:04 Problem with request: Get http://rails:3000: dial tcp 172.20.0.2:3000: connect: connection refused. Sleeping 20s
sidekiq_1        | 2021/05/02 08:12:06 Problem with request: Get http://rails:3000: dial tcp 172.20.0.2:3000: connect: connection refused. Sleeping 20s
seed_1           | 2021/05/02 08:12:24 Problem with request: Get http://rails:3000: dial tcp 172.20.0.2:3000: connect: connection refused. Sleeping 20s
sidekiq_1        | 2021/05/02 08:12:26 Problem with request: Get http://rails:3000: dial tcp 172.20.0.2:3000: connect: connection refused. Sleeping 20s
seed_1           | 2021/05/02 08:12:44 Problem with request: Get http://rails:3000: dial tcp 172.20.0.2:3000: connect: connection refused. Sleeping 20s
sidekiq_1        | 2021/05/02 08:12:46 Problem with request: Get http://rails:3000: dial tcp 172.20.0.2:3000: connect: connection refused. Sleeping 20s
seed_1           | 2021/05/02 08:13:04 Problem with request: Get http://rails:3000: dial tcp 172.20.0.2:3000: connect: connection refused. Sleeping 20s
sidekiq_1        | 2021/05/02 08:13:06 Problem with request: Get http://rails:3000: dial tcp 172.20.0.2:3000: connect: connection refused. Sleeping 20s
seed_1           | 2021/05/02 08:13:24 Problem with request: Get http://rails:3000: dial tcp 172.20.0.2:3000: connect: connection refused. Sleeping 20s
sidekiq_1        | 2021/05/02 08:13:26 Problem with request: Get http://rails:3000: dial tcp 172.20.0.2:3000: connect: connection refused. Sleeping 20s
seed_1           | 2021/05/02 08:13:44 Problem with request: Get http://rails:3000: dial tcp 172.20.0.2:3000: connect: connection refused. Sleeping 20s
sidekiq_1        | 2021/05/02 08:13:46 Problem with request: Get http://rails:3000: dial tcp 172.20.0.2:3000: connect: connection refused. Sleeping 20s
seed_1           | 2021/05/02 08:14:04 Problem with request: Get http://rails:3000: dial tcp 172.20.0.2:3000: connect: connection refused. Sleeping 20s
sidekiq_1        | 2021/05/02 08:14:06 Problem with request: Get http://rails:3000: dial tcp 172.20.0.2:3000: connect: connection refused. Sleeping 20s
seed_1           | 2021/05/02 08:14:24 Problem with request: Get http://rails:3000: dial tcp 172.20.0.2:3000: connect: connection refused. Sleeping 20s
sidekiq_1        | 2021/05/02 08:14:26 Problem with request: Get http://rails:3000: dial tcp 172.20.0.2:3000: connect: connection refused. Sleeping 20s
Gracefully stopping... (press Ctrl+C again to force)
Stopping forem_seed          ... done
Stopping forem_sidekiq       ... done
Stopping forem_webpacker     ... done
Stopping forem_rails         ...
Stopping forem_postgresql    ...
Stopping forem_elasticsearch ...
Stopping forem_redis         ...
Killing forem_rails          ... error
Killing forem_postgresql     ... done
Killing forem_elasticsearch  ... done
Killing forem_redis          ... done

ERROR: for forem_rails  Cannot kill container: 59ee94ed8bf994078a2da68204f5909645aa8e4914e24b7d1240101002e1a9b9: Container 59ee94ed8bf994078a2da68204f5909645aa8e4914e24b7d1240101002e1a9b9 is not running

And when I Ctrl+C to stop the server, I got the final error above.

Attempting to go to localhost:3000 just only shows the default react page.

Environment:

  • windows 10
  • Docker version 19.03.8, build afacb8b
  • docker-compose version 1.25.5, build 8a1c60f6

@Link2Twenty
Copy link
Contributor Author

I'd recommend going the WSL route for installation, it's much easier.
https://docs.forem.com/installation/windows/

@oyeyipo
Copy link
Contributor

oyeyipo commented May 3, 2021

Thanks, @Link2Twenty for the pointer. I jumped straight to the container submenu.
Decide the through with Windows WSL installation and all was great and good. Ran the bin/setup command. I got some errors at the command: bin/rails app_initializer:setup forem:setup

I tried adding USERNAME and PASSWORD to the DATABASE_URL, got the following error:

== Preparing database ==
rails aborted!
ActiveRecord::ConnectionNotEstablished: FATAL:  password authentication failed for user "<username>"
/home/user/code/osc/forem/bin/rails:5:in `<top (required)>'
/home/user/code/osc/forem/bin/spring:10:in `require'
/home/user/code/osc/forem/bin/spring:10:in `block in <top (required)>'
/home/user/code/osc/forem/bin/spring:7:in `tap'
/home/user/code/osc/forem/bin/spring:7:in `<top (required)>'

Caused by:
PG::ConnectionBad: FATAL:  password authentication failed for user "<username>"
/home/user/code/osc/forem/bin/rails:5:in `<top (required)>'
/home/user/code/osc/forem/bin/spring:10:in `require'
/home/user/code/osc/forem/bin/spring:10:in `block in <top (required)>'
/home/user/code/osc/forem/bin/spring:7:in `tap'
/home/user/code/osc/forem/bin/spring:7:in `<top (required)>'
Tasks: TOP => db:prepare
(See full trace by running task with --trace)

The database URL config in .env file

# my edit
DATABASE_URL="postgresql://<username>:<password>@localhost:5432/$DATABASE_NAME"

# default
DATABASE_URL="postgresql://localhost:5432/$DATABASE_NAME"

@Link2Twenty
Copy link
Contributor Author

The bit where it says <username>:<password> does that contain the actual username and password for the database?

@oyeyipo
Copy link
Contributor

oyeyipo commented May 3, 2021

It did contain it. I edited it out before commenting. Both the username and the password.

@Link2Twenty
Copy link
Contributor Author

Link2Twenty commented May 3, 2021

The error indicates it doesn't like the username and password supplied.

I would log back in as the user, let's say it's andrew for this example, and change their password.

sudo -u andrew psql
\password

We'll say I entered the password word 'password', super secure I know.

The username and password don't have to be super secure as they're just for your test database. I would also update the name rather than using the variable, just because it feels safer to me.

You'll end up with something like this.

DATABASE_URL="postgresql://andrew:password@localhost:5432/Forem_development"

@cmgorton
Copy link
Contributor

cmgorton commented May 3, 2021

Thanks for the help on this @Link2Twenty 💜

@cmgorton cmgorton added the bug smash Approved bugs for the DEV community bug smash label May 4, 2021
@oyeyipo
Copy link
Contributor

oyeyipo commented May 4, 2021

Unbeknownst to me, the main cause of the failed authentication issue was that the PostgreSQL was running on a different port as suppose to the conventional 5432 port. Discovered this by running the '\conninfo' after login into the user's psql shell.

andrew=# \conninfo
You are connected to database "andrew" as user "andrew" via socket in "/var/run/postgresql" at port "5433".

@oyeyipo
Copy link
Contributor

oyeyipo commented May 6, 2021

Hey @cmgorton @Link2Twenty, bin/startup; specifically foreman start -f Procfile.dev, throws an error. Not just sidekiq, but also the web instance through webpack and database config.

There was a reoccurring theme. The env variables are being read as a whole, both with inline comments. As is the case below.

15:00:54 web.1       | started with pid 3142
15:00:54 webpacker.1 | started with pid 3143
15:00:54 sidekiq.1   | started with pid 3144
15:01:05 sidekiq.1   | 2021-05-06T14:01:05.691Z pid=3144 tid=8zs WARN: ArgumentError: invalid value for Integer(): "5 # Specifies the number of Puma threads"
15:01:05 sidekiq.1   | 2021-05-06T14:01:05.692Z pid=3144 tid=8zs WARN: /home/testuser01/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sidekiq-6.2.1/lib/sidekiq/cli.rb:246:in `Integer'
15:01:05 sidekiq.1   | /home/testuser01/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sidekiq-6.2.1/lib/sidekiq/cli.rb:246:in `setup_options'
15:01:05 sidekiq.1   | /home/testuser01/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sidekiq-6.2.1/lib/sidekiq/cli.rb:24:in `parse'
15:01:05 sidekiq.1   | /home/testuser01/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/sidekiq-6.2.1/bin/sidekiq:27:in `<top (required)>'
15:01:05 sidekiq.1   | /home/testuser01/.rbenv/versions/2.7.2/bin/sidekiq:23:in `load'
15:01:05 sidekiq.1   | /home/testuser01/.rbenv/versions/2.7.2/bin/sidekiq:23:in `<top (required)>'
15:01:05 sidekiq.1   | /home/testuser01/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-2.2.16/lib/bundler/cli/exec.rb:63:in `load'
15:01:05 sidekiq.1   | /home/testuser01/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-2.2.16/lib/bundler/cli/exec.rb:63:in `kernel_load'
15:01:05 sidekiq.1   | /home/testuser01/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-2.2.16/lib/bundler/cli/exec.rb:28:in `run'
15:01:05 sidekiq.1   | /home/testuser01/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-2.2.16/lib/bundler/cli.rb:494:in `exec'
15:01:05 sidekiq.1   | /home/testuser01/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-2.2.16/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
15:01:05 sidekiq.1   | /home/testuser01/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-2.2.16/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
15:01:05 sidekiq.1   | /home/testuser01/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-2.2.16/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
15:01:05 sidekiq.1   | /home/testuser01/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-2.2.16/lib/bundler/cli.rb:30:in `dispatch'
15:01:05 sidekiq.1   | /home/testuser01/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-2.2.16/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
15:01:05 sidekiq.1   | /home/testuser01/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-2.2.16/lib/bundler/cli.rb:24:in `start'
15:01:05 sidekiq.1   | /home/testuser01/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-2.2.16/exe/bundle:49:in `block in <top (required)>'
15:01:05 sidekiq.1   | /home/testuser01/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-2.2.16/lib/bundler/friendly_errors.rb:130:in `with_friendly_errors'
15:01:05 sidekiq.1   | /home/testuser01/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/bundler-2.2.16/exe/bundle:37:in `<top (required)>'
15:01:05 sidekiq.1   | /home/testuser01/.rbenv/versions/2.7.2/bin/bundle:23:in `load'
15:01:05 sidekiq.1   | /home/testuser01/.rbenv/versions/2.7.2/bin/bundle:23:in `<main>'
15:01:06 sidekiq.1   | exited with code 1
15:01:06 system      | sending SIGTERM to all processes
15:01:06 web.1       | terminated by SIGTERM
15:01:06 webpacker.1 | terminated by SIGTERM

== Command ["foreman start -f Procfile.dev"] failed ==

The .env file was create from .env_sample. I think all inline comments and variables should be removed/repositioned to avoid such issues.

@rhymes
Copy link
Contributor

rhymes commented May 6, 2021

@oyeyipowale can you replace your lines:

RAILS_MAX_THREADS=5 # Specifies the number of Puma threads
WEB_CONCURRENCY=2 # Specifies the number of `workers` to boot in clustered mode.
DATABASE_POOL_SIZE=5 # The number of concurrent connections to Postgres. If unset the value of RAILS_MAX_THREADS will be used in it's place.

with just:

RAILS_MAX_THREADS=5
WEB_CONCURRENCY=2
DATABASE_POOL_SIZE=5

I'll send a PR shortly to fix that :)

@cmgorton
Copy link
Contributor

cmgorton commented May 6, 2021

Thank you @rhymes !

@Link2Twenty
Copy link
Contributor Author

Oh yeah I had that problem too 😅

@alicenstar
Copy link

alicenstar commented May 6, 2021

I was having this same issue with the same-line comments in the .env file. I fixed that, but then was getting this error: FATAL: database "$DATABASE_NAME" does not exist, so DATABASE_NAME wasn't getting translated into the DATABASE_URL.

I fixed it by hard-coding the DATABASE_NAME into the DATABASE_URL, but I'm guessing that syntax must be wrong or something for the nested environment variables. I tried several things (removing quotes, changing $DATABASE_NAME to ${DATABASE_NAME}, and combinations of those), but nothing worked besides hard-coding the name into the url.

Solution:

DATABASE_NAME=Forem_development
DATABASE_URL=postgresql://localhost:5432/Forem_development

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: design Use for all tasks related to UX, UI, visual, or interaction design. bug smash Approved bugs for the DEV community bug smash bug always open for contribution external contributors welcome contribution is welcome! tech: frontend changes will primarily involve frontend technologies
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants