i have a screen (view) which i use to list all instances of an entity in a table. if i double-click on a row, i am taken to a screen where i can edit that entity.

there is a button on the list screen which if clicked, takes me to the same view used for edits, but this time with empty fields, for creating a new instance of the entity.

sometimes(!), if i have edited and saved an entity, returned to the list and clicked the "new" button, when i am taken to the screen for creating a new entity, it has values populated from the entity i have just been editing. is there anything in servicestack that might cause this 'leakage' of data?

many thanks.

EDIT: should say that this is a servicestack.razor (the new api) implementation with c#, with no use of mvc at all.

Any chance you can create a stand-alone prototype that exhibits this behavior?
–
mythzJan 22 '13 at 18:51

hi - thanks for your reply. it would be quite difficult to take any kind of vertical slice through the application. if i could manage to disentangle something, what should i do with it?
–
windknotJan 22 '13 at 21:26

If you can post a link to a GitHub repo, that would be ideal. All I'd need is a small project that reproduces the unintended behavior.
–
mythzJan 22 '13 at 21:31

hi - i have put up a zipped solution here podsol.co.uk/servicestack/sstest.zip this has the observed behaviour. there is a sql script in the sql folder. run this to create the small test d/base. many thanks
–
windknotJan 23 '13 at 10:07

Can't open it in VS 2010, is this a VS 2012 sln? I don't have this at home, will look at it at work once I find the free time.
–
mythzJan 24 '13 at 10:43

1 Answer
1

sorry, i thought that the project i indicated highlights the issue perfectly. i'm not sure what more you'd need. at the risk of repeating myself,

with a couple of rows of data in the d/base, load up the data in the listings page. this shows a table of the data.

double click on a row to produce a screen which has a form. the form is populated with the data from the row.

go back to the listings page.

now hit the "new" button. this produces the same view which was used to render the row you clicked on in step 2.

see that the form in the view is populated with the old data from the previous rendering, when in fact it should be empty because you want to use the form to create a new entity.

what seems to be happening is that the first time the view (form) is rendered, (are they not precompiled?) it is put into the cache. the problem is that any data which are in the form elements (textboxes etc) seems to be put into the cache as well. so, when you then use the view to try to create a new entity, and want all the fields to be empty, it is in fact pre-populated with the old data.

not sure how i can clearer be about this? or how a unit test would help? as i said, the project i put on the website shows this behaviour clearly. i'd be willing to spend more time on it, but i can't afford to wait the long delays between posting here and getting a response. again, i understand you're busy like the rest of us. it might help if you could answer the questions i'd had about how is it that the execute method populates the cache? or does it? the source code is not that clear to follow as there is very little inline documentation with it so i spent quite a bit of time stepping through with the debugger etc etc....and i'm still not clear about some things.

anyway, i apologise if i come across as complaining, don't mean to. the framework has great potential i'm sure.

and i think we should take this offline rather than clutter up stackoverflow?
–
windknotJan 29 '13 at 16:47

I'll retry to repro after work, tonight if I have time otherwise tomorrow.
–
mythzJan 29 '13 at 17:42

Ok it should be fixed in this commit, just had to use a new instance of the HtmlHelper. I've already deployed this fix on ServiceStack.Razor v3.9.36 on NuGet so if you update it should be resolved.
–
mythzJan 30 '13 at 1:37

fixed! many many thanks. that was a real showstopper for me but now we can continue with the porting. that's a beer i owe you! :)
–
windknotJan 30 '13 at 9:09

Cool, tho when you have the free time, I'd settle for a blog post on ServiceStack instead :)
–
mythzJan 30 '13 at 13:38