File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,11 @@ Glossary
3232Releases
3333----------------------
3434
35+ v2.8.5
36+ =================
37+ - Fixed "Object not added to DAF" when accessing broken accounts from remote
38+
39+
3540v2.8.4
3641=================
3742- Fixed web browser waiting time being too little when searching invite links
Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ async def schema_load_from_file() -> None:
142142
143143 trace ("Restoring objects from file..." , TraceLEVELS .NORMAL )
144144 with open (SHILL_LIST_BACKUP_PATH , "rb" ) as reader :
145- accounts = convert .convert_from_semi_dict (pickle .load (reader ))
145+ accounts : List [ client . ACCOUNT ] = convert .convert_from_semi_dict (pickle .load (reader ))
146146
147147 trace ("Updating accounts." , TraceLEVELS .DEBUG )
148148 for account in accounts :
@@ -156,6 +156,8 @@ async def schema_load_from_file() -> None:
156156 TraceLEVELS .ERROR , exc
157157 )
158158 finally :
159+ # Save ID regardless if we failed result otherwise we cannot access though remote
160+ account ._update_tracked_id ()
159161 GLOBALS .accounts .append (account )
160162
161163 trace (f"Restored objects from file ({ len (GLOBALS .accounts )} accounts)." , TraceLEVELS .NORMAL )
Original file line number Diff line number Diff line change @@ -261,12 +261,15 @@ class TrackedClass(cls):
261261 if hasattr (cls , "__slots__" ): # Don't break classes without slots
262262 __slots__ = ("__weakref__" , "_daf_id" )
263263
264- async def initialize (self , * args , ** kwargs ):
265- _r = await super ().initialize (* args , ** kwargs )
266- # Update weakref dictionary
264+ def _update_tracked_id (self ):
265+ "Saves ID to the tracked dictionary"
267266 value = id (self )
268267 self ._daf_id = value
269268 OBJECT_ID_MAP [value ] = self
269+
270+ async def initialize (self , * args , ** kwargs ):
271+ _r = await super ().initialize (* args , ** kwargs )
272+ self ._update_tracked_id ()
270273 return _r
271274
272275 def __getattr__ (self , __key : str ):
You can’t perform that action at this time.
0 commit comments