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

Fix circular dependency detection #194

Merged
merged 4 commits into from
Jul 14, 2021
Merged

Fix circular dependency detection #194

merged 4 commits into from
Jul 14, 2021

Conversation

cbaker6
Copy link
Contributor

@cbaker6 cbaker6 commented Jul 14, 2021

Fixed a bug where the ParseEncoder incorrectly detects a circular dependency when two child objects are the same. The failing test case is below:

func testAllowFieldsWithSameObject() throws {
        var score = GameScore(score: 10)
        var level = Level()
        level.objectId = "nice"
        score.level = level
        score.nextLevel = level

        score.ensureDeepSave { (_, _, parseError) in
            XCTAssertNil(parseError)
        }
    }

@codecov
Copy link

codecov bot commented Jul 14, 2021

Codecov Report

Merging #194 (efd24b7) into main (85b3e76) will increase coverage by 0.14%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #194      +/-   ##
==========================================
+ Coverage   82.88%   83.02%   +0.14%     
==========================================
  Files          73       73              
  Lines        6911     6912       +1     
==========================================
+ Hits         5728     5739      +11     
+ Misses       1183     1173      -10     
Impacted Files Coverage Δ
Sources/ParseSwift/Coding/ParseEncoder.swift 75.31% <100.00%> (+0.15%) ⬆️
Sources/ParseSwift/Protocols/Objectable.swift 96.15% <100.00%> (+12.82%) ⬆️
Sources/ParseSwift/Types/Pointer.swift 83.33% <100.00%> (+2.48%) ⬆️
Sources/ParseSwift/Objects/ParseUser.swift 81.53% <0.00%> (-0.16%) ⬇️
Sources/ParseSwift/Objects/ParseObject.swift 78.72% <0.00%> (+1.32%) ⬆️
Sources/ParseSwift/Coding/ParseCoding.swift 91.48% <0.00%> (+2.12%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 85b3e76...efd24b7. Read the comment docs.

@cbaker6 cbaker6 merged commit f395990 into main Jul 14, 2021
@cbaker6 cbaker6 deleted the circular branch July 14, 2021 23:44
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

Successfully merging this pull request may close these issues.

1 participant