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

Adapting: duplicate phrase entries #591

Closed
eb1 opened this issue Aug 20, 2024 · 1 comment · Fixed by #592 or #594
Closed

Adapting: duplicate phrase entries #591

eb1 opened this issue Aug 20, 2024 · 1 comment · Fixed by #592 or #594

Comments

@eb1
Copy link
Contributor

eb1 commented Aug 20, 2024

Describe the bug
While adapting, I came across a couple instances when moving forward to the next word/phrase to adapt, where the adaptation engine would recognize a phrase from the KB and suggest the translation, BUT it would enter the phrase multiple times in the text. Screen shot:
dups

Note the "El qui" and "la seva" phrases are added several times in the text. Looking at the database, it appears that Adapt It Mobile has added this phrase several times to the sourcephrases table, with the same ID and order (i.e., these are true duplicates).

I was able to reproduce the behavior on the same phrases on an iOS and Android simulator -- looking at the debugger, it looks like it's hitting the maximum call stack size. This is not due to recursion, but to multiple nested calls:

 [Error] RangeError: Maximum call stack size exceeded.
stringify (sourcephrase.js:67)
create (sourcephrase.js:67)
sync (sourcephrase.js:107)
save (backbone-min.js:1:7260)
v (backbone-min.js:1:3358)
d (backbone-min.js:1:3083)
u (backbone-min.js:1:904)
(anonymous function) (backbone-min.js:1:2963)
set (backbone-min.js:1:5618)
save (backbone-min.js:1:6820)
unselectedAdaptation (AdaptViews.js:3042)
    (etc.)

To Reproduce
Steps to reproduce the behavior:

  1. Launch AIM and create a project from Catalan to Spanish
  2. Import the attached file 43_jhn_cat.usfm.txt
  3. Adapt the text up to verse 16
  4. Note the multiple entries in the text.

Additional context
Book of John in Catalan:

43_jhn_cat.usfm.txt

@eb1 eb1 added this to the Release 1.17.0 milestone Aug 20, 2024
@eb1 eb1 mentioned this issue Aug 20, 2024
@eb1 eb1 closed this as completed in #592 Aug 20, 2024
eb1 added a commit that referenced this issue Aug 20, 2024
@eb1 eb1 reopened this Aug 21, 2024
@eb1
Copy link
Contributor Author

eb1 commented Aug 21, 2024

Looks like this is still occurring without the stack overflow. Investigating further...

eb1 added a commit to eb1/adapt-it-mobile that referenced this issue Aug 23, 2024
- Make source phrase object more asynchronous, and wait until db INSERT returns successfully before continuing.
- Add phrase boundary checks for getLargestPhrase, so it stops at punctuation, etc.
@eb1 eb1 mentioned this issue Aug 26, 2024
@eb1 eb1 closed this as completed in #594 Aug 26, 2024
eb1 added a commit that referenced this issue Aug 26, 2024
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 a pull request may close this issue.

1 participant