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

Description & Version incorrect #354

Closed
gigaga opened this issue Jul 23, 2018 · 10 comments
Closed

Description & Version incorrect #354

gigaga opened this issue Jul 23, 2018 · 10 comments
Labels

Comments

@gigaga
Copy link

gigaga commented Jul 23, 2018

Currently, after editing an API, if I edit another API, description & version fields are filled with the previous API. Furethemore, this incorrect data is stored in database because "onMessage" is executed (in EditApiDesignEndpoint)

Thx

@EricWittmann
Copy link
Member

I must admit this is pretty shocking. :( I'll make this today's priority and it might warrant an emergency build...

@EricWittmann
Copy link
Member

Note: it seems to be duplicating the most recent change, whatever it might be. Very bad.

@gigaga
Copy link
Author

gigaga commented Jul 23, 2018

I am trying to understand too. Maybe, the problem is due to "openEditingSession" method in apis.service.ts?
I don't know if it is linked but, sometimes (often), after editing with a new description of an API, I go back to apis list page and my api updated is displayed with the old value of this description (in database, it is correct).

@EricWittmann
Copy link
Member

OK I've found and fixed the problem. Unintended consequence of another change. But basically I have an angular service shared across various editor components called CommandService. It's used to communicate when a sub-component causes a command (change) to be executed.

But I wasn't resetting the service each time the editor was opened. The service exposes an Observer that the editor uses to listen for commands that need to be executed. Because the service wasn't reset between editing sessions, that same Observer was used every time. So the last executed Command was being dispatched to the new editor immediately when it subscribed.

The solution is to reset the service when the editor is initialized. :)

@gigaga
Copy link
Author

gigaga commented Jul 23, 2018

Great!!! Thx!

@gigaga
Copy link
Author

gigaga commented Jul 23, 2018

Where is your commit?

@EricWittmann
Copy link
Member

Just testing now. :)

@gigaga
Copy link
Author

gigaga commented Jul 23, 2018

:)

@EricWittmann
Copy link
Member

OK looks good now. Thanks for finding and reporting this!

@gigaga
Copy link
Author

gigaga commented Jul 23, 2018

It's work! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants