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

Defaults and optional parameters are sometimes serialised as null #31

Closed
stijnherreman opened this issue Feb 21, 2014 · 7 comments
Closed

Comments

@stijnherreman
Copy link

I don't like the sometimes part of this bug. I can randomly reproduce it by setting and removing debug="true" to force it to regenerate. So far I've seen it multiple times in the minified version and one time on the regular version, so I don't think it's related to minification.

Most of the times this is generated:

window.Router = new RouteJs.RouteManager({
    "routes": [{
        "url": "",
        "defaults": {
            "language": "nl",
            "controller": "Dashboard",
            "action": "Index"
        },
        "constraints": {},
        "optional": []
    }, {
        "url": "logging/exceptions/{resource}/{subResource}",
        "defaults": {
            "controller": "Logging",
            "action": "Exceptions"
        },
        "constraints": {},
        "optional": ["resource", "subResource"]
    }, {
        "url": "{language}/{controller}/{action}/{id}",
        "defaults": {},
        "constraints": {},
        "optional": ["id"]
    }, {
        "url": "{language}/{controller}",
        "defaults": {},
        "constraints": {},
        "optional": []
    }],
    "baseUrl": "/"
});

Sometimes this is generated:

window.Router = new RouteJs.RouteManager({
    "routes": [{
        "url": "",
        "defaults": null,
        "constraints": {},
        "optional": null
    }, {
        "url": "logging/exceptions/{resource}/{subResource}",
        "defaults": null,
        "constraints": {},
        "optional": null
    }, {
        "url": "{language}/{controller}/{action}/{id}",
        "defaults": null,
        "constraints": {},
        "optional": null
    }, {
        "url": "{language}/{controller}",
        "defaults": null,
        "constraints": {},
        "optional": null
    }],
    "baseUrl": "/"
});

Any idea what could cause this?

@Daniel15
Copy link
Owner

Hm that's really weird. Do you see any errors at all when this occurs?

@stijnherreman
Copy link
Author

No errors at all. I'll probably have some time this week to build from source and see if I can find more info.

@yuji1982
Copy link

yuji1982 commented Apr 3, 2014

I have identified what is causing this problem.

This problem is reproducible when you restart IIS and access
routejs.axd before accessing an MVC application.

Since you haven't loaded RouteJS.Mvc.dll at this point in routejs.axd,
IDefaultsProcessor is not registered in ComponentRegistration, and
routeInfo.Defaults and other settings are blank.

I'm sorry but I haven't figured out what is the appropriate solution
for this problem,
so this is only a report of the cause.

As a temporary measure, I'm accessing the Type of RouteJS.Mvc.dll in
Application_Start to load the DLL.

@Daniel15
Copy link
Owner

Daniel15 commented Apr 3, 2014

Nice find, thanks for reporting. I've got some ideas, I'll work on a fix
soon.

Sent from my mobile.
On Apr 3, 2014 3:24 AM, "yuji1982" notifications@github.com wrote:

I have identified what is causing this problem.

This problem is reproducible when you restart IIS and access
routejs.axd before accessing an MVC application.

Since you haven't loaded RouteJS.Mvc.dll at this point in routejs.axd,
IDefaultsProcessor is not registered in ComponentRegistration, and
routeInfo.Defaults and other settings are blank.

I'm sorry but I haven't figured out what is the appropriate solution
for this problem,
so this is only a report of the cause.

As a temporary measure, I'm accessing the Type of RouteJS.Mvc.dll in
Application_Start to load the DLL.

Reply to this email directly or view it on GitHubhttps://github.com//issues/31#issuecomment-39435777
.

@Daniel15
Copy link
Owner

This should be fixed in 1.1.6 as I've switched to using WebActivator for initialising the IoC container. Thanks for reporting!

@mbiasetti
Copy link

Hi, just wanted to let you know that this was happening to me as well on 1.1.4. It also occurred if I left my PC for a while and came back and just refreshed the page. I'm going to install 1.1.7 now and see if it continues to occur.

@Daniel15
Copy link
Owner

Daniel15 commented Aug 3, 2014

Thanks, let me know if you still see the issue.

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

No branches or pull requests

4 participants