removeFromDb parameter of nsIAutoCompleteResult::RemoveValueAt is always true
Categories
(Toolkit :: Autocomplete, enhancement, P5)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox77 | --- | fixed |
People
(Reporter: standard8, Assigned: aarushivij, Mentored)
Details
(Keywords: good-first-bug, Whiteboard: [lang=js|cpp])
Attachments
(1 file)
The removeFromDb parameter of nsIAutoCompleteResult::RemoveValueAt is always set to true:
https://searchfox.org/mozilla-central/search?q=RemoveValueAt&redirect=false
We could probably tidy that up a bit and clean up some code.
Updated•7 years ago
|
| Reporter | ||
Updated•7 years ago
|
Comment 1•7 years ago
|
||
Hey, can I take this up? Let me know how to fix it.
Comment 3•7 years ago
|
||
Hey Mark,
Can I work on this issue?
I guess we need to put some condition on RemoveValueAt to be true. Let me know what needs to be fixed in it.
Comment 4•7 years ago
|
||
The parameter must be removed from the definition in nsIAutoCompleteResult.idl, from the implementation in nsAutoCompleteSimpleResult.cpp and then from all the call points, the link in comment 0 shows all of them.
Comment 5•7 years ago
|
||
Thanks, @Marco Got it! Working on this.
Comment 6•7 years ago
|
||
So it should be something like this in nsIAutoCompleteResult.idl
void removeValueAt();
and in nsAutoCompleteSimpleResult.cpp file, parameters must also be removed?
nsAutoCompleteSimpleResult::RemoveValueAt(int32_t aRowIndex,
bool aRemoveFromDb) {
CHECK_MATCH_INDEX(aRowIndex, false);
nsString value = mMatches[aRowIndex].mValue;
mMatches.RemoveElementAt(aRowIndex);
if (mListener) {
mListener->OnValueRemoved(this, value, aRemoveFromDb);
}
return NS_OK;
}
Comment 7•7 years ago
|
||
(In reply to paarmita1998 from comment #6)
So it should be something like this in nsIAutoCompleteResult.idl
`
void removeValueAt();
no, the method has 2 arguments, only removeFromDb should be removed, per the bug description.
Comment 8•7 years ago
|
||
I'd suggest starting with getting a Firefox build working, in optimized mode (because it's faster to build). Since this requires to work with cpp, it's important to be able to verify things compile properly. https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Firefox_build
Comment 9•7 years ago
|
||
Hey, will this project run if I install Firefox Artifact as it is a C++ project?
| Reporter | ||
Comment 10•7 years ago
|
||
(In reply to paarmita1998 from comment #9)
Hey, will this project run if I install Firefox Artifact as it is a C++ project?
No, an artifact build does not pick up changes to C++. You'll need a full (optimized) build.
Comment 11•7 years ago
|
||
I couldn't provide a patch for this as I have artifacts version installed. So you can assign it to others.
Thanks for your help.
Comment 12•7 years ago
•
|
||
I would work on it. I have complete build on my laptop already. :)
Thanks
Comment 13•7 years ago
|
||
Hello, I have a complete build installed as well. If no one else takes this up let me know if it's okay to work on it.
Updated•7 years ago
|
Updated•6 years ago
|
Comment 14•6 years ago
|
||
Hi Mark,
If anyone is not working on it currently, can I take this up, to get hands dirty on some artifacts for the first time.
Thanks
Avneesh Singhal
| Reporter | ||
Comment 15•6 years ago
|
||
Well in this case, it is Marco (:mak) that is the mentor, though I'm quite happy to help as well!
Comment 16•6 years ago
|
||
Yeah, but you are the reporter :-) . I will ask Marco if I get stuck somewhere. Thanks for assigning.
Comment 17•6 years ago
|
||
Hi Marco,
I got the change and have done the code changes after running the full optimized build(this step took some time), and the new build is also running fine as it seems. Can you guide me to any automated tests I can do to before raising the patch?
Thanks
Comment 18•6 years ago
|
||
you can run some tests using ./mach test toolkit/components/autocomplete
Comment 19•6 years ago
|
||
(In reply to Marco Bonardo [::mak] from comment #18)
you can run some tests using ./mach test toolkit/components/autocomplete
Thanks for waiting!
There is this test which uses false attribute in removeValueAt instead of as quoted true in all cases, please go through it and let me know what to do with it.
Thanks
Avneesh Singhal
Comment 20•6 years ago
|
||
Because the removeFRomDB argument is going away, you will remove the aRemoveFromDb from the test and as a consequence also this._lastRemoveFromDb. Then you should remove all the test lines involving _lastRemoveFromDb.
all the calls will just be result.removeValueAt(0);
Comment 21•6 years ago
|
||
(In reply to Marco Bonardo [::mak] from comment #20)
Because the removeFRomDB argument is going away, you will remove the aRemoveFromDb from the test and as a consequence also this._lastRemoveFromDb. Then you should remove all the test lines involving _lastRemoveFromDb.
all the calls will just be result.removeValueAt(0);
Thanks, I will do as stated.
| Assignee | ||
Comment 22•6 years ago
|
||
Hello, Can I take up this issue ?
Thanks :)
Aarushi
Comment 23•6 years ago
|
||
Feel free to start working on it, read the previous comments, ensure you have a working build. Feel free to ask questions.
We assign the bug once a patch is attached.
| Assignee | ||
Comment 24•5 years ago
|
||
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Comment 25•5 years ago
|
||
Comment 26•5 years ago
|
||
| bugherder | ||
Description
•