Coder Social home page Coder Social logo

Comments (5)

Werebunny avatar Werebunny commented on July 21, 2024

Hi, sorry you're facing issues.

It seems silly to ask since I haven't updated the library in awhile, but are you on the latest version 1.8.2? I ask because I added recursion loops in my last commit. To try and reproduce the issue, I created a sample object via properties A.B.C.A and could randomize it without issue. The mechanism for this is on the RandomizerChainer, which will add a recursive reference if the previous type has already been created.

Theoretically you shouldn't ever see the InfiniteLoopException, it means I missed a link in the creation chain and didn't set the parent correctly. I've located all the spots where that is seemingly possible, and have attempted a fix.

Nuget should have version 1.8.3 here soon, I'm hoping it fixes your issue. If not, I'll need more details over how your type chain that's triggering the exception appears. Like are collections involved, generics, abstract classes, delegates... ect. As long as I can reproduce the issue with a test model, I'll be able to get it fixed here for you.

from createandfake.

ibebbs avatar ibebbs commented on July 21, 2024

Hey, thanks for getting back to me. .

To answer your questions: Yes, I'm using version 1.8.2 and, while a rich object model, it is fairly simple so it does not use any (custom) generics, inheritance or delegates. It uses collections extensively and the issue I'm seeing involves a collection like so: a->ICollection<b>->c->a.

Hope that will provide some clues as to the nature of the issue. If not, let me know and I'll endeavour to reproduce the issue in a repository I can share.

Thanks again,
Ian

from createandfake.

Werebunny avatar Werebunny commented on July 21, 2024

Did you see if version 1.8.3 worked for you?

I made another branch here to attempt to replicate and solve the issue, you can view the test here:
https://github.com/CreateAndFake/CreateAndFake/blob/Fix-65-InfiniteChainFix/tests/CreateAndFakeTests/IssueReplication/InfiniteChainTests.cs

I did encounter an issue with cloning objects, but not in creating them. So if you don't mind checking the model and comparing with yours I would be grateful.

from createandfake.

ibebbs avatar ibebbs commented on July 21, 2024

Hey, just updated to 1.8.3 and the InfiniteLoopException issue is gone. Great work, thanks!

I'll close this issue now but any interest in a PR to support Uri and DateTimeOffset creation / duplication? I'm using these types extensively and currently need to add custom Create/CopyHints to support them.

from createandfake.

Werebunny avatar Werebunny commented on July 21, 2024

I have added Uri and DateTimeOffset support in the default hints released on version 1.8.4.

from createandfake.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.