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

Pressing F5 at A Plugin Tab Triggers Error KCHAPI6001E "Invalid URL. Redireced to home page." #343

Closed
edwardbadboy opened this issue Mar 11, 2014 · 1 comment
Labels

Comments

@edwardbadboy
Copy link
Member

When I tried to add a plugin tab to kimchi, I found a problem when I refreshing at my tab page.

If I press ctrl+F5 at the tab page add by my plugin, it says "KCHAPI6001E Invalid URL. Redireced to home page." and redirects me to the front page. I did a little
debug and found that it's a AJAX timing problem. When loading the page, it calls kimchi.listPlugins to get the available plugin list from the back-end then it updates the tabs. However the listPlugins is called asynchronously, and needs some time to finish. So when the refesh action triggers an redirect event and calls onKimchiRedirect to redirect to my plugin page, the plugin tabs are not loaded yet. So it redirects me to the front-page instead.

I am able to overcome the problem by adding "async : false,"
in ui/js/src/kimchi.api.js to listPlugins

    listPlugins : function(suc, err) {
        kimchi.requestJSON({
            url : kimchi.url + 'plugins',
            type : 'GET',
            contentType : 'application/json',
            dataType : 'json',
            resend: true,
            async : false,
            success : suc,
            error : err
        });
     }

I'm bad in js, maybe you have a nicer solution.

@adamkingit adamkingit added the bug label Mar 11, 2014
@edwardbadboy
Copy link
Member Author

Submit a patch to add minimal UI for the sample plugin, so that you can easily reproduce the bug.

http://lists.ovirt.org/pipermail/kimchi-devel/2014-March/003800.html

alinefm pushed a commit that referenced this issue Apr 2, 2014
Fixed the 2 issues:
1) When refreshing (F5) a plugin tab, default tab will be redirected then;
2) tabs.xml is requested twice.

Signed-off-by: Hongliang Wang <hlwang@linux.vnet.ibm.com>
@alinefm alinefm closed this as completed Apr 2, 2014
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

3 participants