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

Pulsar Regular Release 1.122.0 and later break Project Plus package's features #1169

Open
5 tasks done
cmeh opened this issue Dec 17, 2024 · 2 comments · May be fixed by #1171
Open
5 tasks done

Pulsar Regular Release 1.122.0 and later break Project Plus package's features #1169

cmeh opened this issue Dec 17, 2024 · 2 comments · May be fixed by #1171
Labels
bug Something isn't working

Comments

@cmeh
Copy link

cmeh commented Dec 17, 2024

Thanks in advance for your bug report!

  • Have you reproduced issue in safe mode?
  • Have you used the debugging guide to try to resolve the issue?
  • Have you checked our FAQs to make sure your question isn't answered there?
  • Have you checked to make sure your issue does not already exist?
  • Have you checked you are on the latest release of Pulsar?

What happened?

First of all, a big 'thank you' to all developers and contributors for their continued development of Pulsar after Microsoft has shut down the Atom Editor. Thank you all very much for keeping this wonderful application alive.

Project Plus is an IMHO popular and useful plugin package for managing projects. Unfortunately, Pulsar's Regular Release 1.122.0 and all releases beyond seem to partly break its' functionality.

In Pulsar 1.121.0 and earlier, Project Plus' Project Finder would be displayed just fine. This GIF animation is from an earlier Atom version, but corresponds to the appearance in Pulsar ≤ 1.121.0:

https://raw.githubusercontent.com/mehcode/atom-project-plus/master/project-plus.gif

In Pulsar 1.122.0 and later, however, pressing the corresponding hotkey now triggers the following error message (screenshots are from the current regular release 1.124.0):

Pulsar 1 124 0 Project Plus

Here's the corresponding, more detailed error message from the Dev Tools:

Pulsar 1 124 0 Project Plus Error Log

... and in plain text:

project-finder-view.js? [sm]:121 Project Plus: Could not list projects: TypeError: Cannot read property 'then' of undefined
    at session.js:20:31
    at new Promise (<anonymous>)
    at findFromIndexedDB (session.js:14:10)
    at session.js:122:9
    at new Promise (<anonymous>)
    at SessionProvider.all (session.js:120:12)
    at provider-manager.js:33:26
    at Array.map (<anonymous>)
    at provider-manager.js:32:39
    at new Promise (<anonymous>)
    at ProviderManager.invoke (provider-manager.js:31:12)
    at ProviderManager.all (provider-manager.js:42:17)
    at ProjectPlusView.populate (project-finder-view.js:115:21)
    at ProjectPlusView.toggle (project-finder-view.js:73:12)
    at HTMLElement.project-plus:toggle-project-finder (project-plus.js:45:49)
    at CommandRegistry.handleCommandEvent (/opt/Pulsar/resources/app.asar/src/command-registry.js:405:43)
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/opt/Pulsar/resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:617:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/opt/Pulsar/resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:408:22)
    at WindowEventHandler.handleDocumentKeyEvent (/opt/Pulsar/resources/app.asar/src/window-event-handler.js:153:34)
(anonymous) @ project-finder-view.js? [sm]:121

Pulsar version

1.122.0 and later

Which OS does this happen on?

🐧 Debian based (Linux Mint, Ubuntu, etc.)

OS details

Debian GNU/Linux 12.8 Bookworm

Which CPU architecture are you running this on?

x86_64/AMD64

What steps are needed to reproduce this?

Steps to reproduce the intended behavior on Windows, macOS and Linux:

  1. Install Pulsar 1.121.0.
  2. Install the Project Plus package within Pulsar.
  3. If necessary, add some projects to the projects.cson file in Pulsar's user folder.
  4. Press CTRL + ALT + P (rsp. for macOS: CTRL + CMD + P) to display Project Plus' Project Finder.

Steps to reproduce the reported issue on Windows, macOS and Linux:

  1. Install Pulsar 1.122.0 or later.
  2. Install the Project Plus package within Pulsar.
  3. If necessary, add some projects to the projects.cson file in Pulsar's user folder.
  4. Press CTRL + ALT + P (rsp. for macOS: CTRL + CMD + P) to display Project Plus' Project Finder. This will result in the error message documented above (and nothing more).

Additional Information:

No response

@cmeh cmeh added the bug Something isn't working label Dec 17, 2024
@cmeh cmeh changed the title Pulsar Regular Release 1.122.0 breaks Project Plus package's features Pulsar Regular Release 1.122.0 and later break Project Plus package's features Dec 17, 2024
@confused-Techie
Copy link
Member

Thanks a ton for contributing!
It seems the error in project-plus is being triggered on this line:

atom.stateStore.dbPromise.then((db) => {

I know in v1.122.0 we did introduce an opt-in by default new StateStore, I'm not totally familiar with all of the changes that occurred in that PR, but pretty sure @mauricioszabo as the author may have some ideas here on why it's failing.

I would've assumed things stayed backwards compatible, but as we do eventually plan to move the state store over, it may be necessary for project-plus to be updated to continue working. But hopefully that's not the case

@confused-Techie
Copy link
Member

Taking a look further, it seems we've compartmentalized the legacy and new database's behind the public class of StateStore.

As I don't think dbPromise was intended to be a public method it wasn't exposed. But since both databases do have this method, it may be possible that we could just expose them for the sake of restoring functionality here, without any adverse side effects

@confused-Techie confused-Techie linked a pull request Dec 18, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants