Skip to content

XML Support - Part 1b#325

Merged
fda-odoo merged 1 commit intomasterfrom
master-xml-part2-fda
Jul 4, 2025
Merged

XML Support - Part 1b#325
fda-odoo merged 1 commit intomasterfrom
master-xml-part2-fda

Conversation

@fda-odoo
Copy link
Copy Markdown
Collaborator

No description provided.

@fda-odoo fda-odoo added this to the 0.10.0 milestone Jun 17, 2025
@fda-odoo fda-odoo self-assigned this Jun 17, 2025
@fda-odoo fda-odoo added the enhancement New feature or request label Jun 17, 2025
@fda-odoo fda-odoo force-pushed the master-xml-part2-fda branch 2 times, most recently from ab46514 to fe1856e Compare June 19, 2025 12:24

### OLS30446
"XML ID already exists in module"
You have duplicated XML ID in the same module
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a work-in-progress :) That diagnostic can't stay, as duplicated xml_id IS valid, even if sometimes not wanted.
We are still figuring out what can reliably be diagnosed :)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while working on this kind of task, adding this kind of diagnostic help us browse the code and get structure of it :)

@fda-odoo fda-odoo force-pushed the master-xml-part2-fda branch 2 times, most recently from 8891f59 to 8891fb0 Compare June 19, 2025 14:59
@fda-odoo fda-odoo force-pushed the master-xml-part2-fda branch from 8891fb0 to 8f72a95 Compare July 3, 2025 09:30
@fda-odoo fda-odoo changed the title XML Support - Part 2 XML Support - Part 1b Jul 3, 2025
@fda-odoo fda-odoo modified the milestones: 0.10.0, 0.8.0 Jul 3, 2025
@fda-odoo fda-odoo requested a review from mmahrouss July 3, 2025 11:09
Comment on lines +54 to +59
module.upgrade().unwrap().borrow_mut().as_module_package_mut().xml_ids.insert(xml_id_model_name, vec![Rc::downgrade(&sym)]);
});
Copy link
Copy Markdown
Collaborator

@mmahrouss mmahrouss Jul 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but what happens if that module is reloaded, you do not update the xml id symbol? it will need a new weak symbol, right? so the vector will just keep slowly growing over time?

I do not se that in the code

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, you're right, we could use a weakset instead of a vec to keep it clean over time

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the weakset maintain removing the non-valid weak pointers ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes and no. The PtrWeakHashSet will not actively clean itself. But as soon as you iter on it or try to get an invalid weak, it will be removed from the set and not returned

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay good enouh I think

@fda-odoo fda-odoo force-pushed the master-xml-part2-fda branch from 7983ebe to 07cc216 Compare July 4, 2025 09:30
@fda-odoo fda-odoo force-pushed the master-xml-part2-fda branch from 07cc216 to f72e8ba Compare July 4, 2025 09:33
@fda-odoo fda-odoo merged commit ed03a98 into master Jul 4, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants