Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
briar
briar
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 681
    • Issues 681
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 16
    • Merge Requests 16
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • briar
  • briarbriar
  • Issues
  • #1590

Closed
Open
Opened Jun 18, 2019 by akwizgran@akwizgranOwner
  • Report abuse
  • New issue
Report abuse New issue

IllegalStateException: Cannot invoke setValue on a background thread

Crashed when sending a message to a new contact.

Stacktrace:

java.lang.IllegalStateException: Cannot invoke setValue on a background thread
      at android.arch.lifecycle.LiveData.assertMainThread(LiveData.java:435)
      at android.arch.lifecycle.LiveData.setValue(LiveData.java:279)
      at android.arch.lifecycle.MutableLiveData.setValue(MutableLiveData.java:33)
      at org.briarproject.briar.android.attachment.AttachmentCreator.resetState(AttachmentCreator.java:183)
      at org.briarproject.briar.android.attachment.AttachmentCreator.onAttachmentsSent(AttachmentCreator.java:164)
      at org.briarproject.briar.android.conversation.ConversationViewModel.storeMessage(ConversationViewModel.java:295)
      at org.briarproject.briar.android.conversation.ConversationViewModel.lambda$createMessage$8$ConversationViewModel(ConversationViewModel.java:286)
      at org.briarproject.briar.android.conversation.-$$Lambda$ConversationViewModel$1LsoWDT2XwB7wPxBWawY1IIRFR0.run(Unknown Source:10)
      at org.briarproject.bramble.TimeLoggingExecutor.lambda$execute$0$TimeLoggingExecutor(TimeLoggingExecutor.java:36)
      at org.briarproject.bramble.-$$Lambda$TimeLoggingExecutor$Bqrtbsq_8LcRPoTWBOef6xh7gJg.run(Unknown Source:6)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
      at java.lang.Thread.run(Thread.java:784)

This is my fault - I recommended moving the onAttachmentsSent() call to a place that's on the UI thread on my branch, forgetting that it's on the crypto executor on master.

Assignee
Assign to
Android 1.2
Milestone
Android 1.2
Assign milestone
Time tracking
None
Due date
None
Reference: briar/briar#1590