Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Exception splitting markdown preview #3976

Closed

Description

@kevinsawicki

I'm opening in this in core since the stack trace seems mostly core related:

Uncaught Error: The workspace can only contain one instance of item [object Object] item-registry.coffee:8
module.exports.ItemRegistry.addItem item-registry.coffee:8
module.exports.PaneContainer.addedPaneItem pane-container.coffee:224
(anonymous function) pane-container.coffee:218
module.exports.Emitter.emit /Users/kevin/github/atom/node_modules/event-kit/lib/emitter.js:71
module.exports.Pane.addItem pane.coffee:326
module.exports.Pane.activateItem pane.coffee:307
(anonymous function) markdown-preview-view.coffee:97
(anonymous function) markdown-preview-view.coffee:103
module.exports.Emitter.emit /Users/kevin/github/atom/node_modules/emissary/lib/emitter.js:118
(anonymous function)

Steps to reproduce

  • Open a markdown file
  • Preview it
  • Focus the preview
  • Split the preview to the left
  • Edit the markdown file.
  • Error shows up

Activity

  1. nathansobo commented on Oct 27, 2014

    @nathansobo
    Contributor

    @kevinsawicki This is just a new rule. To keep the correspondence between views and models simple, you can never have two copies of the same exact model in the workspace. Otherwise we would need to deal with the potential for multiple views being returned for the same model, which isn't worth the added complexity in the API.

  2. kevinsawicki commented on Oct 27, 2014

    @kevinsawicki
    ContributorAuthor

    But this broke backwards compatibility right?

  3. nathansobo commented on Oct 27, 2014

    @nathansobo
    Contributor

    It did. Do you think we should shim it to still work? I don't think it's worth the complexity. I didn't realize we were inserting the same object into the workspace in the package.

  4. kevinsawicki commented on Oct 27, 2014

    @kevinsawicki
    ContributorAuthor

    Maybe just fixing it for now in the markdown preview and track how prevalent it is in other packages.

    It looks like 22 people have hit it already: https://bugsnag.com/atom/atom/errors/542450b96e470317e8bc9ec4

  5. nathansobo commented on Oct 27, 2014

    @nathansobo
    Contributor

    Sorry about that. This sort of slipped through early in the process before I was thinking as clearly about API compatibility. Maybe I can think of a way to support it.

  6. nathansobo commented on Nov 10, 2014

    @nathansobo
    Contributor

    After thinking and discussing the broader problem extensively, I think the best approach for now is just to leave this and allow people to adapt. The best ideas I could come up with to recover from this added pretty substantial complexity. For example, we could automatically remove a pane item when attempting to add it again. My concern is that this is somewhat unexpected behavior as well. Seems like a better policy to just force people to follow the rules, even though it's a breaking change.

  7. lock commented on Jan 25, 2019

    @lock

    This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

  8. locked as resolved and limited conversation to collaborators on Jan 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions