nyyManni / ejira

Emacs JIRA integration
GNU General Public License v3.0
256 stars 35 forks source link

ejira-update-my-projects does not run all the way on first run until buffer is saved to file #21

Open chaorace opened 4 years ago

chaorace commented 4 years ago

I struggled with this issue a fair amount earlier today. I kept running jira-update-my-projects, but the generated buffer was always incomplete! As it turns out, the function was failing because global org id lookup uses whatever is saved to file, ignoring buffer contents. Since this was a first-time run, there were no such files and the function was failing silently as a result.

The workaround for this issue is to save the incomplete project buffer to file, then rerun jira-update-my-projects. Once the file actually exists, the issue stops occurring.

I believe the best fix for this would be to check if the file exists first. If the file does not exist, write the top level outline, with project IDs, to buffer and save, then proceed as usual.