No internet connection
  1. Home
  2. Issues

Notifications cannot be set on posts without comments or likes

By Thomas Graf @thomas_graf
    2019-05-20 15:04:35.599Z

    I'm using talkyard as the commenting system on my blog: https://outde.xyz. Some of my blog's readers would like to get notifications for specific posts even if there are no comments yet. This does not work for two reasons:

    1. Without any comments, the vertical height of the pull-down menu for notifications is too small. The menu gets clipped vertically. As a result, the Every post option is barely visible (only a blue line at the very top).

    2. Since the comment thread hasn't been created yet, selecting any notification option produces an Internal Server Error (copy-pasted at the end). I currently work around that by liking every new post, but that's tedious.

    You can test this yourself for this old post (I hope nobody comments or likes it in the meantime): https://outde.xyz/2019-04-20/adding-metadata-to-your-article.html#adding-metadata-to-your-article

    Error 500 Internal Server Error
    Something went wrong: [DwE500EXC]
    
    org.postgresql.util.PSQLException: ERROR: insert or update on table "page_notf_prefs3" violates foreign key constraint "pagenotfprefs_r_pages"
      Detail: Key (site_id, page_id)=(440, 0) is not present in table "pages3".
    	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440)
    	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183)
    	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308)
    	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
    	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
    	at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:150)
    	at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:127)
    	at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)
    	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)
    	at com.debiki.dao.rdb.Rdb.execImpl(Rdb.scala:492)
    	at com.debiki.dao.rdb.Rdb.update(Rdb.scala:454)
    	at com.debiki.dao.rdb.RdbSiteTransaction.runUpdate(RdbSiteTransaction.scala:282)
    	at com.debiki.dao.rdb.RdbSiteTransaction.runUpdateSingleRow(RdbSiteTransaction.scala:287)
    	at com.debiki.dao.rdb.PageNotfPrefsSiteTxMixin.upsertPageNotfPref(PageNotfPrefsSiteTxMixin.scala:85)
    	at com.debiki.dao.rdb.PageNotfPrefsSiteTxMixin.upsertPageNotfPref$(PageNotfPrefsSiteTxMixin.scala:47)
    	at com.debiki.dao.rdb.RdbSiteTransaction.upsertPageNotfPref(RdbSiteTransaction.scala:38)
    	at debiki.dao.UserDao.$anonfun$savePageNotfPref$1(UserDao.scala:1267)
    	at debiki.dao.UserDao.$anonfun$savePageNotfPref$1$adapted(UserDao.scala:1266)
    	at debiki.dao.UserDao.$anonfun$editMemberThrowUnlessSelfStaff$1(UserDao.scala:1637)
    	at debiki.dao.UserDao.$anonfun$editMemberThrowUnlessSelfStaff2$4(UserDao.scala:1671)
    	at debiki.dao.SiteDao.$anonfun$readWriteTransaction$2(SiteDao.scala:155)
    	at com.debiki.core.DbDao2.readWriteSiteTransaction(DbDao2.scala:67)
    	at debiki.dao.SiteDao.$anonfun$readWriteTransaction$1(SiteDao.scala:155)
    	at debiki.dao.SiteDao$.synchronizeOnSiteId(SiteDao.scala:450)
    	at debiki.dao.SiteDao.readWriteTransaction(SiteDao.scala:154)
    	at debiki.dao.UserDao.editMemberThrowUnlessSelfStaff2(UserDao.scala:1660)
    	at debiki.dao.UserDao.editMemberThrowUnlessSelfStaff2$(UserDao.scala:1648)
    	at debiki.dao.SiteDao.editMemberThrowUnlessSelfStaff2(SiteDao.scala:71)
    	at debiki.dao.UserDao.editMemberThrowUnlessSelfStaff(UserDao.scala:1636)
    	at debiki.dao.UserDao.editMemberThrowUnlessSelfStaff$(UserDao.scala:1634)
    	at debiki.dao.SiteDao.editMemberThrowUnlessSelfStaff(SiteDao.scala:71)
    	at debiki.dao.UserDao.savePageNotfPref(UserDao.scala:1266)
    	at debiki.dao.UserDao.savePageNotfPref$(UserDao.scala:1265)
    	at debiki.dao.SiteDao.savePageNotfPref(SiteDao.scala:71)
    	at controllers.UserController.$anonfun$saveContentNotfPref$1(UserController.scala:1135)
    	at scala.Function1.$anonfun$andThen$1(Function1.scala:57)
    	at ed.server.http.PlainApiActions$$anon$1.runBlockIfAuthOk(PlainApiActions.scala:406)
    	at ed.server.http.PlainApiActions$$anon$1.invokeBlockAuthViaCookie(PlainApiActions.scala:231)
    	at ed.server.http.PlainApiActions$$anon$1.invokeBlock(PlainApiActions.scala:123)
    	at ed.server.http.PlainApiActions$$anon$1.invokeBlock(PlainApiActions.scala:83)
    	at play.api.mvc.ActionBuilder$$anon$2.apply(Action.scala:419)
    	at ed.server.http.PlainApiActions$$anon$1.$anonfun$composeAction$1(PlainApiActions.scala:97)
    	at ed.server.http.SafeActions$ExceptionAction$.invokeBlock(SafeActions.scala:115)
    	at ed.server.http.SafeActions$ExceptionAction$.invokeBlock(SafeActions.scala:82)
    	at play.api.mvc.ActionBuilder$$anon$2.apply(Action.scala:419)
    	at play.api.mvc.Action.$anonfun$apply$2(Action.scala:96)
    	at play.api.libs.streams.StrictAccumulator.$anonfun$mapFuture$4(Accumulator.scala:174)
    	at scala.util.Try$.apply(Try.scala:213)
    	at play.api.libs.streams.StrictAccumulator.$anonfun$mapFuture$3(Accumulator.scala:174)
    	at scala.Function1.$anonfun$andThen$1(Function1.scala:57)
    	at scala.Function1.$anonfun$andThen$1(Function1.scala:57)
    	at play.api.libs.streams.StrictAccumulator.run(Accumulator.scala:211)
    	at play.core.server.AkkaHttpServer.$anonfun$runAction$4(AkkaHttpServer.scala:377)
    	at akka.http.scaladsl.util.FastFuture$.strictTransform$1(FastFuture.scala:41)
    	at akka.http.scaladsl.util.FastFuture$.$anonfun$transformWith$3(FastFuture.scala:51)
    	at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
    	at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
    	at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:91)
    	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
    	at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:85)
    	at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:91)
    	at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:40)
    	at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:44)
    	at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
    	at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
    	at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
    	at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
    
    • 7 replies
    1. Progress
      with handling this problem
    2. @KajMagnus marked this topic as Planned 2019-05-21 03:18:27.336Z.
    3. Hi Thomas, thanks for reporting, & for including the stack trace.

      I can reproduce both these two problems on localhost. I'll fix this. Could take one or two weeks before I've deployed the fix (because there're a bunch of other changes that'll go in the same new vertion, which I need to add "lots of" tests for).

      (B.t.w. a temporary workaround that also handles the too-small-iframe + too-large-dialog issue, could be to post a dummy comment instead of clicking Like?)

      1. T
        Thomas Graf @thomas_graf
          2019-05-22 17:33:30.654Zreplies toKajMagnus:

          Thanks for the quick reply. For now I'll just treat the issue as an incentive to create lively discussions within minutes after posting ;)

          1. I've fixed this now in the master branch (this commit). This'll probably be deployed in about 1.5 weeks.

            1. Hi Thomas, Now I've deployed the fix. (Both problem 1 and problem 2.)

              Would you like to try and see if works for you? The next time you publish a blog post i suppose

              1. T
                Thomas Graf @thomas_graf
                  2019-06-09 16:30:38.984Zreplies toKajMagnus:

                  Awesome! It definitely expands correctly now to show all notification options, very nifty. I don't currently have a post without any comments or likes. I'll check once the next one goes up and let you know if there's any problems.

                  1. T
                    Thomas Graf @thomas_graf
                      2019-06-13 20:17:45.170Zreplies tothomas_graf:

                      Just verified that it also works correctly with new posts. However, I think the notification template also needs to be updated. Right now, the system automatically creates a new thread for a post and then sends out an email "You have replies to posts of yours", which can be a bit confusing. This should probably say something like "A new topic has been automatically created".

                      1. Thanks for mentioning this weird "You have replies ..." notification, that's something I didn't think about. — I'm thinking no notification or email should be sent at all, until the first reply has been posted?
                        (and that this "You have replies ..." email is a bug)

                        1. @KajMagnus marked this topic as Done 2019-10-14 12:35:00.598Z.