getodk / briefcase

ODK Briefcase is a Java application for fetching and pushing forms and their contents. It helps make billions of data points from ODK portable. Contribute and make the world a better place! ✨💼✨
https://docs.getodk.org/briefcase-intro
Other
60 stars 156 forks source link

Crash on attempted cancel of pull from Central server when offline #876

Open lognaturel opened 3 years ago

lognaturel commented 3 years ago

Software versions

Briefcase v1.17.4

Problem description

Crash on attempted cancel of pull from Central server when offline

Steps to reproduce the problem

  1. Open Briefcase, get a form list from a Central server
  2. Go offline
  3. Initiate pull, see it hang. Cancel pull, see crash.

Expected behavior

It should be possible to cancel a pull even when offline.

Other information

There's an NPE in PullPanel's onCancel handler when pullJobRunner is null. I think Central.pull is never returning in that scenario. If we try to only cancel if pullJobRunner is non-null, then we end up with the job resuming once connectivity is established and the button having the wrong state.

This works fine with an Aggregate server.